-
Notifications
You must be signed in to change notification settings - Fork 30k
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: #48913 Backport-PR-URL: #49225 Fixes: #48867 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
- Loading branch information
1 parent
08738b2
commit 4bc0a8f
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