converts from v8 coverage format to istanbul's coverage format.
const v8toIstanbul =// the path to the original source-file is required, as its contents are// used during the conversion algorithm.const converter =await converter // this is required due to the async source-map dependency.// provide an array of coverage information in v8 format.converter// output coverage information in a form that can// be consumed by Istanbul.console
Ignoring Uncovered Lines
Sometimes you might find yourself wanting to ignore uncovered lines in your application (for example, perhaps you run your tests in Linux, but there's code that only executes on Windows).
To ignore lines, use the special comment
/* c8 ignore next */.
ignoring the next line
const myVariable = 99/* c8 ignore next */if processplatform === 'win32' console
ignoring the next N lines
const myVariable = 99/* c8 ignore next 3 */if processplatform === 'win32'console
ignoring the same line as the comment
const myVariable = 99const os = processplatform === 'darwin' ? 'OSXy' /* c8 ignore next */ : 'Windowsy'
To execute tests, simply run: