@start/plugin-lib-istanbul
v2.0.0
Published
💯 Collect, report and check code coverage using Istanbul
Downloads
35
Readme
💯 plugin-lib-istanbul
Collect, report and check code coverage using Istanbul.
Install
$ yarn add --dev @start/plugin-lib-istanbul
Usage
Signature
istanbulInstrument(extensions?: string[])
options
extensions
File extensions to instrument, for example ['.ts']
import type { ReportType } from 'istanbul-reports'
istanbulReports(formats: ReportType[] = ['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(),
find('test/**/*.js'),
tape(),
istanbulReport(['lcovonly', 'html', 'text-summary']),
istanbulThresholds({ functions: 100 })
)