Skip to content

Commit fb0dcd4

Browse files
authored
Have runtests always throw on failure, make rm stream signal end of read queue (microsoft#30035)
1 parent 592396d commit fb0dcd4

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

scripts/build/tests.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
140140
await deleteTemporaryProjectOutput();
141141

142142
if (error !== undefined) {
143-
if (watchMode) {
144-
throw error;
145-
}
146-
else {
147-
log.error(error);
148-
process.exit(typeof errorStatus === "number" ? errorStatus : 2);
149-
}
143+
process.exitCode = typeof errorStatus === "number" ? errorStatus : 2;
144+
throw error;
150145
}
151146
}
152147
exports.runConsoleTests = runConsoleTests;

scripts/build/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ function rm(dest, opts) {
340340
duplex.push(file);
341341
cb();
342342
}
343+
duplex.push(null); // signal end of read queue
343344
};
344345

345346
const duplex = new Duplex({

0 commit comments

Comments
 (0)