Skip to content

Commit 48634a4

Browse files
committed
modify test script error handling
1 parent bf679c4 commit 48634a4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ if (args.includes("-u")) {
2626
jestArgs.push("-u");
2727
}
2828

29-
execSync(`jest ${jestArgs.join(" ")}`, {
30-
env: process.env,
31-
stdio: "inherit"
32-
});
29+
try {
30+
execSync(`jest ${jestArgs.join(" ")}`, {
31+
env: process.env,
32+
stdio: "inherit"
33+
});
34+
} catch (_) {
35+
// Reduces the console noise in the event of a failing test and ensure CI
36+
// failure.
37+
process.exit(1);
38+
}

0 commit comments

Comments
 (0)