Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Assume failure in case the async task vanishes.

Anders Kaseorgb248e2d9313d
diff --git a/web/tests/lib/index.cjs b/web/tests/lib/index.cjs
index b65543c2baa..391d0307807 100644
--- a/web/tests/lib/index.cjs
+++ b/web/tests/lib/index.cjs
@@ -101,6 +101,10 @@ async function run_one_module(file) {
test.set_verbose(files.length === 1);
+// In case someone mistakenly vanishes the async task with something like `await
+// new Promise(() => {})`, assume failure until we establish otherwise.
+process.exitCode = 1;
+
(async () => {
let exit_code = 0;
@@ -144,8 +148,7 @@ test.set_verbose(files.length === 1);
namespace.finish();
}
- process.exit(exit_code);
+ process.exitCode = exit_code;
})().catch((error) => /* istanbul ignore next */ {
console.error(error);
- process.exit(1);
});