forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: fix global after not failing the tests
PR-URL: nodejs#48913 Fixes: nodejs#48867 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
- Loading branch information
Showing
6 changed files
with
103 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/fixtures/test-runner/output/global_after_should_fail_the_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
const { it, after } = require('node:test'); | ||
|
||
after(() => { | ||
throw new Error('this should fail the test') | ||
}); | ||
|
||
it('this is a test', () => { | ||
console.log('this is a test') | ||
}); |
34 changes: 34 additions & 0 deletions
34
test/fixtures/test-runner/output/global_after_should_fail_the_test.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
this is a test | ||
TAP version 13 | ||
# Subtest: this is a test | ||
ok 1 - this is a test | ||
--- | ||
duration_ms: * | ||
... | ||
not ok 2 - /test/fixtures/test-runner/output/global_after_should_fail_the_test.js | ||
--- | ||
duration_ms: * | ||
failureType: 'hookFailed' | ||
error: 'this should fail the test' | ||
code: 'ERR_TEST_FAILURE' | ||
stack: |- | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
... | ||
1..1 | ||
# tests 1 | ||
# suites 0 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters