node/test/fixtures/test-runner/output/hooks.snapshot
Tim Stableford 4b583bfcc5
lib: allow checking the test result from afterEach
PR-URL: https://github.com/nodejs/node/pull/51485
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-02-15 12:05:43 +01:00

649 lines
12 KiB
Text

- after() called
TAP version 13
# Subtest: describe hooks
# Subtest: 1
ok 1 - 1
---
duration_ms: *
...
# Subtest: 2
ok 2 - 2
---
duration_ms: *
...
# Subtest: nested
# Subtest: nested 1
ok 1 - nested 1
---
duration_ms: *
...
# Subtest: nested 2
ok 2 - nested 2
---
duration_ms: *
...
1..2
ok 3 - nested
---
duration_ms: *
type: 'suite'
...
1..3
ok 1 - describe hooks
---
duration_ms: *
type: 'suite'
...
# Subtest: before throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'cancelledByParent'
error: 'test did not finish before its parent and was cancelled'
code: 'ERR_TEST_FAILURE'
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'cancelledByParent'
error: 'test did not finish before its parent and was cancelled'
code: 'ERR_TEST_FAILURE'
...
1..2
not ok 2 - before throws
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'hookFailed'
error: 'before'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
# Subtest: after throws
# Subtest: 1
ok 1 - 1
---
duration_ms: *
...
# Subtest: 2
ok 2 - 2
---
duration_ms: *
...
1..2
not ok 3 - after throws
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'hookFailed'
error: 'after'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
# Subtest: beforeEach throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'hookFailed'
error: 'beforeEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
async Promise.all (index 0)
*
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'hookFailed'
error: 'beforeEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
...
1..2
not ok 4 - beforeEach throws
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
async Promise.all (index 0)
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
1..2
not ok 5 - afterEach throws
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach when test fails
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'testCodeFailure'
error: 'test'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
new Promise (<anonymous>)
*
*
Array.map (<anonymous>)
...
# Subtest: 2
ok 2 - 2
---
duration_ms: *
...
1..2
not ok 6 - afterEach when test fails
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '1 subtest failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach throws and test fails
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'testCodeFailure'
error: 'test'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
new Promise (<anonymous>)
*
*
Array.map (<anonymous>)
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
1..2
not ok 7 - afterEach throws and test fails
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: test hooks
# Subtest: 1
ok 1 - 1
---
duration_ms: *
...
# Subtest: 2
ok 2 - 2
---
duration_ms: *
...
# Subtest: nested
# Subtest: nested 1
ok 1 - nested 1
---
duration_ms: *
...
# Subtest: nested 2
ok 2 - nested 2
---
duration_ms: *
...
1..2
ok 3 - nested
---
duration_ms: *
...
1..3
ok 8 - test hooks
---
duration_ms: *
...
# Subtest: t.before throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'before'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'before'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
1..2
not ok 9 - t.before throws
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: t.beforeEach throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'beforeEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'beforeEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
1..2
not ok 10 - t.beforeEach throws
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: t.afterEach throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
1..2
not ok 11 - t.afterEach throws
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach when test fails
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'testCodeFailure'
error: 'test'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
# Subtest: 2
ok 2 - 2
---
duration_ms: *
...
1..2
not ok 12 - afterEach when test fails
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '1 subtest failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach context when test passes
# Subtest: 1
ok 1 - 1
---
duration_ms: *
...
1..1
ok 13 - afterEach context when test passes
---
duration_ms: *
...
# Subtest: afterEach context when test fails
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'testCodeFailure'
error: 'test'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
...
1..1
not ok 14 - afterEach context when test fails
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '1 subtest failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: afterEach throws and test fails
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'testCodeFailure'
error: 'test'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
# Subtest: 2
not ok 2 - 2
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
failureType: 'hookFailed'
error: 'afterEach'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
*
...
1..2
not ok 15 - afterEach throws and test fails
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'subtestsFailed'
error: '2 subtests failed'
code: 'ERR_TEST_FAILURE'
...
# Subtest: t.after() is called if test body throws
not ok 16 - t.after() is called if test body throws
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'testCodeFailure'
error: 'bye'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
...
# - after() called
# Subtest: run after when before throws
# Subtest: 1
not ok 1 - 1
---
duration_ms: *
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3'
failureType: 'cancelledByParent'
error: 'test did not finish before its parent and was cancelled'
code: 'ERR_TEST_FAILURE'
...
1..1
not ok 17 - run after when before throws
---
duration_ms: *
type: 'suite'
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
failureType: 'hookFailed'
error: 'before'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
*
*
...
1..17
# before 1 called
# before 2 called
# after 1 called
# after 2 called
# tests 43
# suites 9
# pass 16
# fail 24
# cancelled 3
# skipped 0
# todo 0
# duration_ms *