Skip to content

Commit

Permalink
test for merge raw
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Sep 29, 2024
1 parent a4c8e9e commit 609a3f7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"test-demo": "node ./test/test-demo.js",
"test-merge": "node ./test/test-merge.js",
"test-merge-istanbul": "node ./test/test-merge-istanbul.js",
"test-merge-v8": "node ./test/test-merge-v8.js",
"test-client": "node ./test/test-client.js",
"test-all": "node ./test/test.js",
"test-pr": "node --inspect=9230 ./test/test-pr.js",
Expand Down
46 changes: 46 additions & 0 deletions test/test-merge-v8.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require('fs');
const MCR = require('../');
const coverageOptions = {
// logging: 'debug',
reports: [
['v8', {
metrics: ['lines']
}],
['raw', {
// zip: true,
merge: true
}]
],

cleanCache: false,
// clean: false,
inputDir: './.temp/code-coverage/raw-merged',

filter: {
'**/webpack/**': false,
'**/playground/$*': false,
'**/node_modules/**': false,
'**/*': true
},

name: 'My Merge V8 Coverage Report',
outputDir: './.temp/merge-v8-merged',
onEnd: function(coverageResults) {
console.log('end');
}
};

const generate = async () => {

fs.mkdirSync('./.temp/merge-v8/.cache');
fs.readdirSync('./.temp/code-coverage/raw').forEach((n) => {
fs.copyFileSync(`./.temp/code-coverage/raw/${n}`, `./.temp/merge-v8/.cache/${n}`);
});

const mcr = MCR(coverageOptions);
await mcr.generate();


};

generate();

0 comments on commit 609a3f7

Please sign in to comment.