testing: more out-of-editor refinements (#201834)

- Som more tweaks to our own runner scripts to allow asking for the
  generated coverage formats.
- Add actions alongside debug/run for executing coverage profiles
- Finish with displaying function coverage stats in Coverage view,
  allow changing its sort order.

Fixes #200529
Fixes #199380
This commit is contained in:
Connor Peet
2024-01-04 12:22:46 -08:00
committed by GitHub
parent 3b234eab72
commit 0385382382
12 changed files with 450 additions and 138 deletions

View File

@@ -19,11 +19,11 @@ const minimist = require('minimist');
const { takeSnapshotAndCountClasses } = require('../analyzeSnapshot');
/**
* @type {{ build: boolean; run: string; runGlob: string; coverage: boolean; help: boolean; }}
* @type {{ build: boolean; run: string; runGlob: string; coverage: boolean; help: boolean; coverageFormats: string | string[]; coveragePath: string; }}
*/
const args = minimist(process.argv.slice(2), {
boolean: ['build', 'coverage', 'help'],
string: ['run', 'coveragePath'],
string: ['run', 'coveragePath', 'coverageFormats'],
alias: {
h: 'help'
},
@@ -37,6 +37,7 @@ const args = minimist(process.argv.slice(2), {
run: 'Run a single file',
coverage: 'Generate a coverage report',
coveragePath: 'Path to coverage report to generate',
coverageFormats: 'Coverage formats to generate',
help: 'Show help'
}
});
@@ -142,7 +143,7 @@ function main() {
if (code !== 0) {
return;
}
coverage.createReport(args.run || args.runGlob, args.coveragePath);
coverage.createReport(args.run || args.runGlob, args.coveragePath, args.coverageFormats);
});
}