after not failing the root testΒ #48867
Copy link
Copy link
Closed
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Activity
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests
test_runner: fix global after not failing the tests