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 | reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter],
|
17 | reportsDirectory: argv['reports-dir'],
|
18 | tempDirectory: argv.tempDirectory,
|
19 | watermarks: argv.watermarks,
|
20 | resolve: argv.resolve,
|
21 | omitRelative: argv.omitRelative,
|
22 | wrapperLength: argv.wrapperLength
|
23 | })
|
24 | await report.run()
|
25 | if (argv.checkCoverage) checkCoverages(argv, report)
|
26 | }
|