Skip to content

Commit 836d548

Browse files
author
chen ruixiang
committed
Fix: open all features and prevent parallel run during test coverage report generation
1 parent e5bb6db commit 836d548

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@
7171
"lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
7272
"build": "node scripts/build",
7373
"watch": "node scripts/build --watch",
74-
"coverage": "ASC_FEATURES=\"*\" c8 npm run test:coverage",
74+
"coverage": "c8 npm run test",
7575
"test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform",
76-
"test:coverage": "npm run test:parser && npm run test:compiler && npm run test:browser && npm run test:asconfig && npm run test:transform",
7776
"test:parser": "node --enable-source-maps tests/parser",
7877
"test:compiler": "node --enable-source-maps --experimental-wasi-unstable-preview1 --no-warnings tests/compiler",
7978
"test:browser": "node --enable-source-maps tests/browser",

tests/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if (args.help) {
7878
process.exit(0);
7979
}
8080

81-
const features = process.env.ASC_FEATURES ? process.env.ASC_FEATURES.split(",") : [];
81+
const features = process.env.NODE_V8_COVERAGE != null ? ["*"] : process.env.ASC_FEATURES ? process.env.ASC_FEATURES.split(",") : [];
8282
const featuresConfig = require("./features.json");
8383
const basedir = path.join(dirname, "compiler");
8484

@@ -501,7 +501,7 @@ function evaluateResult(failedTests, skippedTests) {
501501
}
502502

503503
// Run tests in parallel if requested
504-
if (args.parallel && coreCount > 2) {
504+
if (args.parallel && coreCount > 2 && process.env.NODE_V8_COVERAGE == null) {
505505
if (cluster.isWorker) {
506506
process.on("message", msg => {
507507
if (msg.cmd != "run") throw Error("invalid command: " + JSON.stringify(msg));

0 commit comments

Comments
 (0)