1 | const { checkCoverages } = require('./check-coverage')
|
2 | const Report = require('../report')
|
3 |
|
4 | exports.command = 'report'
|
5 |
|
6 | exports.describe = 'read V8 coverage data from temp and output report'
|
7 |
|
8 | exports.handler = async function (argv) {
|
9 | await exports.outputReport(argv)
|
10 | }
|
11 |
|
12 | exports.outputReport = async function (argv) {
|
13 | const report = Report({
|
14 | include: argv.include,
|
15 | exclude: argv.exclude,
|
16 | excludeAfterRemap: argv.excludeAfterRemap,
|
17 | reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter],
|
18 | reportsDirectory: argv['reports-dir'],
|
19 | tempDirectory: argv.tempDirectory,
|
20 | watermarks: argv.watermarks,
|
21 | resolve: argv.resolve,
|
22 | omitRelative: argv.omitRelative,
|
23 | wrapperLength: argv.wrapperLength,
|
24 | all: argv.all,
|
25 | allowExternal: argv.allowExternal,
|
26 | src: argv.src,
|
27 | skipFull: argv.skipFull
|
28 | })
|
29 | await report.run()
|
30 | if (argv.checkCoverage) await checkCoverages(argv, report)
|
31 | }
|