diff --git a/test/nonthrowing_error_handler.mjs b/test/nonthrowing_error_handler.mjs index 3d841f2..52a85eb 100644 --- a/test/nonthrowing_error_handler.mjs +++ b/test/nonthrowing_error_handler.mjs @@ -16,4 +16,3 @@ function open_nonexistant_file() { } const file = open_nonexistant_file(); - diff --git a/test/test_throwing_error_handler.mjs b/test/test_throwing_error_handler.mjs index 3bc2973..53a68fc 100644 --- a/test/test_throwing_error_handler.mjs +++ b/test/test_throwing_error_handler.mjs @@ -34,7 +34,9 @@ async function test_default_error_handler() { // verify that the default error handler does not throw, // and that it prints an error message to stderr const child_process = spawnSync("/usr/bin/env", ["node", "test/nonthrowing_error_handler.mjs"]); - const { stderr } = child_process; + const { stderr, status } = child_process; + // status should be zero, no error thrown: + assert.strictEqual(status, 0); const error_message = stderr.toString(); const lines = error_message.split("\n"); assert(lines.length > 2, "error message should have more than 2 lines");