mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Merge coverages
This commit is contained in:
19
scripts/coverage.ts
Normal file
19
scripts/coverage.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { execSync } from 'child_process';
|
||||
import { cp } from 'fs/promises';
|
||||
|
||||
const main = async () => {
|
||||
const coverageDir = 'coverage';
|
||||
const coverageFiles = ['vitest', 'cypress'].map(
|
||||
(dir) => `${coverageDir}/${dir}/coverage-final.json`
|
||||
);
|
||||
|
||||
//copy coverage files from vitest and cypress to coverage folder
|
||||
await Promise.all(
|
||||
coverageFiles.map((file) => cp(file, `${coverageDir}/combined/${file.split('/')[1]}.json`))
|
||||
);
|
||||
|
||||
execSync('npx nyc merge coverage/combined coverage/combined-final.json');
|
||||
execSync('npx nyc report -t coverage --report-dir coverage/html --reporter=html-spa');
|
||||
};
|
||||
|
||||
void main();
|
Reference in New Issue
Block a user