Collect, report and check code coverage using Istanbul.
$ yarn add --dev @start/plugin-lib-istanbul
# or
$ npm install --save-dev @start/plugin-lib-istanbul
istanbulInstrument(options?: InstrumenterOptions, extensions?: string[])
File extensions to instrument, for example ['.ts']
istanbulReports(formats: string[] = ['lcovonly', 'text-summary'])
istanbulThresholds(options: {
branches?: number,
functions?: number,
lines?: number,
statements?: number
})
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 })
)