Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Latest commit

 

History

History

plugin-lib-istanbul

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

💯 plugin-lib-istanbul

npm linux windows coverage deps

Collect, report and check code coverage using Istanbul.

Install

$ yarn add --dev @start/plugin-lib-istanbul
# or
$ npm install --save-dev @start/plugin-lib-istanbul

Usage

Signature

istanbulInstrument(options?: InstrumenterOptions, extensions?: string[])

options

Istanbul instrumenter options

extensions

File extensions to instrument, for example ['.ts']

istanbulReports(formats: string[] = ['lcovonly', 'text-summary'])
istanbulThresholds(options: {
  branches?: number,
  functions?: number,
  lines?: number,
  statements?: number
})

Example

import sequence from '@start/plugin-sequence'
import find from '@start/plugin-find'
import {
  istanbulInstrument,
  istanbulReport,
  istanbulThresholds
} from '@start/plugin-lib-istanbul'
import tape from '@start/plugin-lib-tape'

export const task = () =>
  sequence(
    find('src/**/*.js'),
    istanbulInstrument({ esModules: true }),
    find('test/**/*.js'),
    tape(),
    istanbulReport(['lcovonly', 'html', 'text-summary']),
    istanbulThresholds({ functions: 100 })
  )