test: fix false-pos in runner due to exit code
This commit is contained in:
parent
1012cdd3fa
commit
a320962aa8
2 changed files with 6 additions and 2 deletions
|
|
@ -114,7 +114,7 @@ export const testSuite = (
|
||||||
`[TEST] suite "${suiteName}": ${passed} of ${tests.length} succeeded\n\n`
|
`[TEST] suite "${suiteName}": ${passed} of ${tests.length} succeeded\n\n`
|
||||||
);
|
);
|
||||||
if (passed < tests.length) {
|
if (passed < tests.length) {
|
||||||
process.exit(1);
|
process.exitCode = 1;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,9 @@ const files = fs.readdirSync(TEST_SUITES_DIR);
|
||||||
shuffle(files);
|
shuffle(files);
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const fullPath = path.join(TEST_SUITES_DIR, file);
|
const fullPath = path.join(TEST_SUITES_DIR, file);
|
||||||
fork(path.relative(process.cwd(), fullPath));
|
fork(path.relative(process.cwd(), fullPath)).on("exit", (code) => {
|
||||||
|
if (code !== 0) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue