-
Notifications
You must be signed in to change notification settings - Fork 6
/
generate-report.js
41 lines (28 loc) · 959 Bytes
/
generate-report.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const EC = require('eight-colors');
const MCR = require('../');
const checkSnapshot = require('./check-snapshot.js');
const generate = async () => {
const dir = '.temp/v8-coverage-env';
const coverageOptions = {
// logging: 'debug',
// watermarks: [60, 90],
reports: ['v8'],
name: 'My V8 Node env Coverage Report',
assetsPath: '../assets',
// lcov: true,
dataDir: dir,
entryFilter: {
'**/test/mock/node/**': true
},
outputDir: './docs/node-env',
onEnd: function(coverageResults) {
checkSnapshot(coverageResults);
}
};
const coverageReport = MCR(coverageOptions);
// clean cache before add coverage data
coverageReport.cleanCache();
const coverageResults = await coverageReport.generate();
console.log('test-node-env coverage reportPath', EC.magenta(coverageResults.reportPath));
};
generate();