Skip to content

Commit b95a834

Browse files
committed
Ensure test failures fail the build.
1 parent eed01c1 commit b95a834

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tasks/testTasks.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,31 @@ gulp.task("test:feature", async () => {
1616
CODE_WORKSPACE_ROOT: rootPath,
1717
};
1818

19-
return spawnNode([featureTestRunnerPath], { env });
19+
const result = await spawnNode([featureTestRunnerPath], { env });
20+
21+
if (result.code > 0) {
22+
// Ensure that gulp fails when tests fail
23+
throw new Error(`Exit code: ${result.code} Signal: ${result.signal}`);
24+
}
25+
26+
return result;
2027
});
2128

2229
gulp.task("test:unit", async () => {
23-
return spawnNode([
30+
const result = await spawnNode([
2431
mochaPath,
2532
'--ui',
2633
'tdd',
2734
'-c',
2835
'test/unitTests/**/*.test.ts'
2936
]);
37+
38+
if (result.code > 0) {
39+
// Ensure that gulp fails when tests fail
40+
throw new Error(`Exit code: ${result.code} Signal: ${result.signal}`);
41+
}
42+
43+
return result;
3044
});
3145

3246
gulp.task("test:integration:singleCsproj", async () => {

0 commit comments

Comments
 (0)