Bug Report Checklist
Expected
Tests should fail if there's an unhandled rejection with no process-level listener.
Actual
As demonstrated in #5505, a test which throws an unhandled promise rejection inside runner code will cause the mocha process to exit with status code 0.
Minimal, Reproducible Example
$ echo 'it("t", async () => { require("node:assert").deepEqual(Object.create(null), { a:1 }); });' > demo.js; npx mocha demo.js; echo $?
0
Versions
$ node --version
v22.14.0
$ npx mocha --version
11.7.4
Additional Info
No response
Bug Report Checklist
faqlabel, but none matched my issue.Expected
Tests should fail if there's an unhandled rejection with no process-level listener.
Actual
As demonstrated in #5505, a test which throws an unhandled promise rejection inside runner code will cause the mocha process to exit with status code 0.
Minimal, Reproducible Example
Versions
Additional Info
No response