Version
v21.0.0-pre (master)
Platform
No response
Subsystem
test_runner
What steps will reproduce the bug?
after not failing the test
const {it, after} = require("node:test");
after(() => {
throw new Error('after')
});
it("it", function tes() {
});
this pass as well
after(() => {
throw new Error('after')
});
describe('desc', () => {
it("it", () => {
});
});
if the after had process.exit(1) it would fail as the hook called but registering the error
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
the after should fail the tests
What do you see instead?
~/dev/open-source/node/node-fork/out/Release/node --test ./tmp.js
✔ it (0.772958ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 898.444625
Process finished with exit code 0
Additional information
it seems that the after does not report that it failed (The fail method does call for both the <root> and the hook)
Version
v21.0.0-pre (master)
Platform
No response
Subsystem
test_runnerWhat steps will reproduce the bug?
afternot failing the testthis pass as well
if the
afterhadprocess.exit(1)it would fail as the hook called but registering the errorHow often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
the
aftershould fail the testsWhat do you see instead?
Additional information
it seems that the
afterdoes not report that it failed (Thefailmethod does call for both the<root>and the hook)