From c735349f899c749f33d081b54767df728002cc71 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 8 Aug 2023 00:22:33 -0400 Subject: [PATCH] update tap reporter --- lib/internal/test_runner/reporter/tap.js | 16 ++++++--- .../test-runner/output/abort.snapshot | 14 ++++++++ .../test-runner/output/abort_hooks.snapshot | 10 ++++++ .../test-runner/output/abort_suite.snapshot | 7 ++++ .../test-runner/output/describe_it.snapshot | 33 +++++++++++++++++++ ...global_after_should_fail_the_test.snapshot | 1 + .../test-runner/output/hooks.snapshot | 30 +++++++++++++++++ .../test-runner/output/no_refs.snapshot | 2 ++ .../test-runner/output/output.snapshot | 31 +++++++++++++++++ .../test-runner/output/output_cli.snapshot | 31 +++++++++++++++++ ...h_should_not_affect_further_tests.snapshot | 4 +++ .../output/unresolved_promise.snapshot | 2 ++ test/parallel/test-runner-output.mjs | 1 + 13 files changed, 177 insertions(+), 5 deletions(-) diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js index de8188c58dd31e..1f60cfa619886e 100644 --- a/lib/internal/test_runner/reporter/tap.js +++ b/lib/internal/test_runner/reporter/tap.js @@ -31,13 +31,14 @@ async function * tapReporter(source) { yield `TAP version ${kDefaultTAPVersion}\n`; for await (const { type, data } of source) { switch (type) { - case 'test:fail': + case 'test:fail': { yield reportTest(data.nesting, data.testNumber, 'not ok', data.name, data.skip, data.todo); - yield reportDetails(data.nesting, data.details); + const location = `${data.file}:${data.line}:${data.column}`; + yield reportDetails(data.nesting, data.details, location); break; - case 'test:pass': + } case 'test:pass': yield reportTest(data.nesting, data.testNumber, 'ok', data.name, data.skip, data.todo); - yield reportDetails(data.nesting, data.details); + yield reportDetails(data.nesting, data.details, null); break; case 'test:plan': yield `${indent(data.nesting)}1..${data.count}\n`; @@ -81,13 +82,18 @@ function reportTest(nesting, testNumber, status, name, skip, todo) { return line; } -function reportDetails(nesting, data = kEmptyObject) { +function reportDetails(nesting, data = kEmptyObject, location) { const { error, duration_ms } = data; const _indent = indent(nesting); let details = `${_indent} ---\n`; details += jsToYaml(_indent, 'duration_ms', duration_ms); details += jsToYaml(_indent, 'type', data.type); + + if (location) { + details += jsToYaml(_indent, 'location', location); + } + details += jsToYaml(_indent, null, error, new SafeSet()); details += `${_indent} ...\n`; return details; diff --git a/test/fixtures/test-runner/output/abort.snapshot b/test/fixtures/test-runner/output/abort.snapshot index f756377172da65..c52915ab9a7fa6 100644 --- a/test/fixtures/test-runner/output/abort.snapshot +++ b/test/fixtures/test-runner/output/abort.snapshot @@ -24,6 +24,7 @@ TAP version 13 not ok 5 - not ok 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:11:7' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -32,6 +33,7 @@ TAP version 13 not ok 6 - not ok 2 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:12:7' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -40,6 +42,7 @@ TAP version 13 not ok 7 - not ok 3 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:13:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -60,6 +63,7 @@ TAP version 13 not ok 8 - not ok 4 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:14:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -80,6 +84,7 @@ TAP version 13 not ok 9 - not ok 5 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:15:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -100,6 +105,7 @@ TAP version 13 not ok 1 - promise timeout signal --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:5:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 @@ -114,6 +120,7 @@ not ok 1 - promise timeout signal not ok 2 - promise abort signal --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:21:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -154,6 +161,7 @@ not ok 2 - promise abort signal not ok 5 - not ok 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:30:5' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -162,6 +170,7 @@ not ok 2 - promise abort signal not ok 6 - not ok 2 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:31:5' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -170,6 +179,7 @@ not ok 2 - promise abort signal not ok 7 - not ok 3 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:32:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -190,6 +200,7 @@ not ok 2 - promise abort signal not ok 8 - not ok 4 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:33:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -210,6 +221,7 @@ not ok 2 - promise abort signal not ok 9 - not ok 5 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort.js:34:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -230,6 +242,7 @@ not ok 2 - promise abort signal not ok 3 - callback timeout signal --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:25:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 @@ -244,6 +257,7 @@ not ok 3 - callback timeout signal not ok 4 - callback abort signal --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort.js:39:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 diff --git a/test/fixtures/test-runner/output/abort_hooks.snapshot b/test/fixtures/test-runner/output/abort_hooks.snapshot index a1b5ddcd5f1908..8542927542fc91 100644 --- a/test/fixtures/test-runner/output/abort_hooks.snapshot +++ b/test/fixtures/test-runner/output/abort_hooks.snapshot @@ -12,6 +12,7 @@ TAP version 13 not ok 1 - test 1 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_hooks.js:11:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -20,6 +21,7 @@ TAP version 13 not ok 2 - test 2 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_hooks.js:14:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -29,6 +31,7 @@ not ok 1 - 1 before describe --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_hooks.js:4:1' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -61,6 +64,7 @@ not ok 2 - 2 after describe --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_hooks.js:19:1' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -82,6 +86,7 @@ not ok 2 - 2 after describe not ok 1 - test 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort_hooks.js:41:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -102,6 +107,7 @@ not ok 2 - 2 after describe not ok 2 - test 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort_hooks.js:44:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -123,6 +129,7 @@ not ok 3 - 3 beforeEach describe --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_hooks.js:34:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -132,6 +139,7 @@ not ok 3 - 3 beforeEach describe not ok 1 - test 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort_hooks.js:56:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -152,6 +160,7 @@ not ok 3 - 3 beforeEach describe not ok 2 - test 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort_hooks.js:59:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 @@ -173,6 +182,7 @@ not ok 4 - 4 afterEach describe --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_hooks.js:49:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/abort_suite.snapshot b/test/fixtures/test-runner/output/abort_suite.snapshot index e2abdadaf5a4b7..45a239b9bb93af 100644 --- a/test/fixtures/test-runner/output/abort_suite.snapshot +++ b/test/fixtures/test-runner/output/abort_suite.snapshot @@ -24,6 +24,7 @@ TAP version 13 not ok 5 - not ok 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/abort_suite.js:10:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -32,6 +33,7 @@ TAP version 13 not ok 6 - not ok 2 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_suite.js:11:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -40,6 +42,7 @@ TAP version 13 not ok 7 - not ok 3 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_suite.js:12:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -60,6 +63,7 @@ TAP version 13 not ok 8 - not ok 4 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_suite.js:13:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -80,6 +84,7 @@ TAP version 13 not ok 9 - not ok 5 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/abort_suite.js:14:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 @@ -101,6 +106,7 @@ not ok 1 - describe timeout signal --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_suite.js:5:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 @@ -116,6 +122,7 @@ not ok 2 - describe abort signal --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/abort_suite.js:19:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 diff --git a/test/fixtures/test-runner/output/describe_it.snapshot b/test/fixtures/test-runner/output/describe_it.snapshot index 0d07851e2a1fa9..8b32d0b76f2d85 100644 --- a/test/fixtures/test-runner/output/describe_it.snapshot +++ b/test/fixtures/test-runner/output/describe_it.snapshot @@ -13,6 +13,7 @@ ok 2 - sync pass todo with message # TODO this is a passing todo not ok 3 - sync todo # TODO --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:15:4' failureType: 'testCodeFailure' error: 'should not count as a failure' code: 'ERR_TEST_FAILURE' @@ -29,6 +30,7 @@ not ok 3 - sync todo # TODO not ok 4 - sync todo with message # TODO this is a failing todo --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:19:1' failureType: 'testCodeFailure' error: 'should not count as a failure' code: 'ERR_TEST_FAILURE' @@ -60,6 +62,7 @@ ok 7 - sync pass not ok 8 - sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:32:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' @@ -91,6 +94,7 @@ ok 11 - mixing describe/it and test should work not ok 12 - async throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:45:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' @@ -107,6 +111,7 @@ not ok 12 - async throw fail not ok 13 - async skip fail # SKIP --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:49:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -115,6 +120,7 @@ not ok 13 - async skip fail # SKIP not ok 14 - async assertion fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:54:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -144,6 +150,7 @@ ok 15 - resolve pass not ok 16 - reject fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:63:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' @@ -186,6 +193,7 @@ ok 21 - immediate resolve pass not ok 1 - +sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:96:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' @@ -211,6 +219,7 @@ not ok 22 - subtest sync throw fail --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:95:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -219,6 +228,7 @@ not ok 22 - subtest sync throw fail not ok 23 - sync throw non-error fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:102:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -270,6 +280,7 @@ ok 27 - sync skip option with message # SKIP this is skipped not ok 28 - sync skip option is false fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:171:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' @@ -346,6 +357,7 @@ ok 40 - callback pass not ok 41 - callback fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:212:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' @@ -372,6 +384,7 @@ ok 44 - callback t is this in test not ok 45 - callback also returns a Promise --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:231:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -380,6 +393,7 @@ not ok 45 - callback also returns a Promise not ok 46 - callback throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:235:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' @@ -396,6 +410,7 @@ not ok 46 - callback throw not ok 47 - callback called twice --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:239:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -412,6 +427,7 @@ ok 48 - callback called twice in different ticks not ok 49 - callback called twice in future tick --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:249:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -422,6 +438,7 @@ not ok 49 - callback called twice in future tick not ok 50 - callback async throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:256:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' @@ -438,6 +455,7 @@ ok 51 - callback async throw after done not ok 52 - custom inspect symbol fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:270:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -446,6 +464,7 @@ not ok 52 - custom inspect symbol fail not ok 53 - custom inspect symbol that throws fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:281:1' failureType: 'testCodeFailure' error: |- { @@ -459,6 +478,7 @@ not ok 53 - custom inspect symbol that throws fail not ok 1 - sync throw fails at first --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:293:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' @@ -478,6 +498,7 @@ not ok 53 - custom inspect symbol that throws fail not ok 2 - sync throw fails at second --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:296:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' @@ -498,6 +519,7 @@ not ok 54 - subtest sync throw fails --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:292:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -507,6 +529,7 @@ not ok 54 - subtest sync throw fails not ok 1 - should not run --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/describe_it.js:302:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -516,6 +539,7 @@ not ok 55 - describe sync throw fails --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:301:1' failureType: 'testCodeFailure' error: 'thrown from describe' code: 'ERR_TEST_FAILURE' @@ -536,6 +560,7 @@ not ok 55 - describe sync throw fails not ok 1 - should not run --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/describe_it.js:307:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -545,6 +570,7 @@ not ok 56 - describe async throw fails --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:306:1' failureType: 'testCodeFailure' error: 'thrown from describe' code: 'ERR_TEST_FAILURE' @@ -565,6 +591,7 @@ not ok 56 - describe async throw fails not ok 1 - timed out async test --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:312:3' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -575,6 +602,7 @@ not ok 56 - describe async throw fails not ok 2 - timed out callback test --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:318:3' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -594,6 +622,7 @@ not ok 57 - timeouts --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:311:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -608,6 +637,7 @@ not ok 57 - timeouts not ok 2 - rejected thenable --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:346:3' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -620,6 +650,7 @@ not ok 58 - successful thenable --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:334:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -629,6 +660,7 @@ not ok 59 - rejected thenable --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/describe_it.js:367:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -668,6 +700,7 @@ ok 60 - async describe function not ok 61 - invalid subtest fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/describe_it.js:157:5' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/global_after_should_fail_the_test.snapshot b/test/fixtures/test-runner/output/global_after_should_fail_the_test.snapshot index 16693c1a8a964b..9cb948a0f12627 100644 --- a/test/fixtures/test-runner/output/global_after_should_fail_the_test.snapshot +++ b/test/fixtures/test-runner/output/global_after_should_fail_the_test.snapshot @@ -8,6 +8,7 @@ ok 1 - this is a test not ok 2 - /test/fixtures/test-runner/output/global_after_should_fail_the_test.js --- duration_ms: * + location: '/test/fixtures/test-runner/output/global_after_should_fail_the_test.js:4:1' failureType: 'hookFailed' error: 'this should fail the test' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/hooks.snapshot b/test/fixtures/test-runner/output/hooks.snapshot index 676e1c7a3287e3..96a2430fa1bd57 100644 --- a/test/fixtures/test-runner/output/hooks.snapshot +++ b/test/fixtures/test-runner/output/hooks.snapshot @@ -38,6 +38,7 @@ ok 1 - describe hooks not ok 1 - 1 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/hooks.js:57:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -46,6 +47,7 @@ ok 1 - describe hooks not ok 2 - 2 --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/hooks.js:58:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -55,6 +57,7 @@ not ok 2 - before throws --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:55:1' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' @@ -85,6 +88,7 @@ not ok 3 - after throws --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:61:1' failureType: 'hookFailed' error: 'after' code: 'ERR_TEST_FAILURE' @@ -104,6 +108,7 @@ not ok 3 - after throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:69:3' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' @@ -123,6 +128,7 @@ not ok 3 - after throws not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:70:3' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' @@ -141,6 +147,7 @@ not ok 4 - beforeEach throws --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:67:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -150,6 +157,7 @@ not ok 4 - beforeEach throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:75:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -169,6 +177,7 @@ not ok 4 - beforeEach throws not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:76:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -188,6 +197,7 @@ not ok 5 - afterEach throws --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:73:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -197,6 +207,7 @@ not ok 5 - afterEach throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:81:3' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' @@ -222,6 +233,7 @@ not ok 6 - afterEach when test fails --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:79:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -231,6 +243,7 @@ not ok 6 - afterEach when test fails not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:87:3' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' @@ -250,6 +263,7 @@ not ok 6 - afterEach when test fails not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:88:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -269,6 +283,7 @@ not ok 7 - afterEach throws and test fails --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/hooks.js:85:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -310,6 +325,7 @@ ok 8 - test hooks not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:129:11' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' @@ -329,6 +345,7 @@ ok 8 - test hooks not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:130:11' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' @@ -348,6 +365,7 @@ ok 8 - test hooks not ok 9 - t.before throws --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:126:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -357,6 +375,7 @@ not ok 9 - t.before throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:136:11' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' @@ -376,6 +395,7 @@ not ok 9 - t.before throws not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:137:11' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' @@ -395,6 +415,7 @@ not ok 9 - t.before throws not ok 10 - t.beforeEach throws --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:133:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -404,6 +425,7 @@ not ok 10 - t.beforeEach throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:143:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -423,6 +445,7 @@ not ok 10 - t.beforeEach throws not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:144:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -442,6 +465,7 @@ not ok 10 - t.beforeEach throws not ok 11 - t.afterEach throws --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:140:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -451,6 +475,7 @@ not ok 11 - t.afterEach throws not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:151:11' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' @@ -474,6 +499,7 @@ not ok 11 - t.afterEach throws not ok 12 - afterEach when test fails --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:148:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -483,6 +509,7 @@ not ok 12 - afterEach when test fails not ok 1 - 1 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:158:11' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' @@ -501,6 +528,7 @@ not ok 12 - afterEach when test fails not ok 2 - 2 --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:159:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' @@ -520,6 +548,7 @@ not ok 12 - afterEach when test fails not ok 13 - afterEach throws and test fails --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:155:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -528,6 +557,7 @@ not ok 13 - afterEach throws and test fails not ok 14 - t.after() is called if test body throws --- duration_ms: * + location: '/test/fixtures/test-runner/output/hooks.js:162:1' failureType: 'testCodeFailure' error: 'bye' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/no_refs.snapshot b/test/fixtures/test-runner/output/no_refs.snapshot index 49c51af41caec3..a36528a3f1acaf 100644 --- a/test/fixtures/test-runner/output/no_refs.snapshot +++ b/test/fixtures/test-runner/output/no_refs.snapshot @@ -4,6 +4,7 @@ TAP version 13 not ok 1 - +does not keep event loop alive --- duration_ms: * + location: '/test/fixtures/test-runner/output/no_refs.js:7:11' failureType: 'cancelledByParent' error: 'Promise resolution is still pending but the event loop has already resolved' code: 'ERR_TEST_FAILURE' @@ -14,6 +15,7 @@ TAP version 13 not ok 1 - does not keep event loop alive --- duration_ms: * + location: '/test/fixtures/test-runner/output/no_refs.js:6:1' failureType: 'cancelledByParent' error: 'Promise resolution is still pending but the event loop has already resolved' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/output.snapshot b/test/fixtures/test-runner/output/output.snapshot index db19d8ca549a38..163c2a70c6ecd1 100644 --- a/test/fixtures/test-runner/output/output.snapshot +++ b/test/fixtures/test-runner/output/output.snapshot @@ -13,6 +13,7 @@ ok 2 - sync pass todo with message # TODO this is a passing todo not ok 3 - sync fail todo # TODO --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:16:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo' code: 'ERR_TEST_FAILURE' @@ -29,6 +30,7 @@ not ok 3 - sync fail todo # TODO not ok 4 - sync fail todo with message # TODO this is a failing todo --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:21:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo with message' code: 'ERR_TEST_FAILURE' @@ -61,6 +63,7 @@ ok 7 - sync pass not ok 8 - sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:38:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' @@ -87,6 +90,7 @@ ok 10 - async pass not ok 11 - async throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:50:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' @@ -103,6 +107,7 @@ not ok 11 - async throw fail not ok 12 - async skip fail # SKIP --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:54:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' @@ -119,6 +124,7 @@ not ok 12 - async skip fail # SKIP not ok 13 - async assertion fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:59:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -148,6 +154,7 @@ ok 14 - resolve pass not ok 15 - reject fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:68:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' @@ -190,6 +197,7 @@ ok 20 - immediate resolve pass not ok 1 - +sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:101:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' @@ -210,6 +218,7 @@ ok 20 - immediate resolve pass not ok 21 - subtest sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:100:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -218,6 +227,7 @@ not ok 21 - subtest sync throw fail not ok 22 - sync throw non-error fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:107:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -253,6 +263,7 @@ ok 23 - level 0a not ok 1 - +long running --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:160:5' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -272,6 +283,7 @@ ok 23 - level 0a not ok 24 - top level --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:159:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -295,6 +307,7 @@ ok 27 - sync skip option with message # SKIP this is skipped not ok 28 - sync skip option is false fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:187:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' @@ -377,6 +390,7 @@ ok 41 - callback pass not ok 42 - callback fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:233:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' @@ -403,6 +417,7 @@ ok 45 - callback t is this in test not ok 46 - callback also returns a Promise --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:252:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -411,6 +426,7 @@ not ok 46 - callback also returns a Promise not ok 47 - callback throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:256:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' @@ -427,6 +443,7 @@ not ok 47 - callback throw not ok 48 - callback called twice --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:260:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -443,6 +460,7 @@ ok 49 - callback called twice in different ticks not ok 50 - callback called twice in future tick --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:270:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -453,6 +471,7 @@ not ok 50 - callback called twice in future tick not ok 51 - callback async throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:277:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' @@ -498,6 +517,7 @@ ok 53 - only is set but not in only mode not ok 54 - custom inspect symbol fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:301:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -506,6 +526,7 @@ not ok 54 - custom inspect symbol fail not ok 55 - custom inspect symbol that throws fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:312:1' failureType: 'testCodeFailure' error: |- { @@ -519,6 +540,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 1 - sync throw fails at first --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:324:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' @@ -538,6 +560,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 2 - sync throw fails at second --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:327:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' @@ -557,6 +580,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 56 - subtest sync throw fails --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:323:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -565,6 +589,7 @@ not ok 56 - subtest sync throw fails not ok 57 - timed out async test --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:332:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -573,6 +598,7 @@ not ok 57 - timed out async test not ok 58 - timed out callback test --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:338:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -596,6 +622,7 @@ ok 61 - successful thenable not ok 62 - rejected thenable --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:364:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -604,6 +631,7 @@ not ok 62 - rejected thenable not ok 63 - unfinished test with uncaughtException --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:375:1' failureType: 'uncaughtException' error: 'foo' code: 'ERR_TEST_FAILURE' @@ -616,6 +644,7 @@ not ok 63 - unfinished test with uncaughtException not ok 64 - unfinished test with unhandledRejection --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:381:1' failureType: 'unhandledRejection' error: 'bar' code: 'ERR_TEST_FAILURE' @@ -628,6 +657,7 @@ not ok 64 - unfinished test with unhandledRejection not ok 65 - assertion errors display actual and expected properly --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:393:1' failureType: 'testCodeFailure' error: |- Expected values to be loosely deep-equal: @@ -659,6 +689,7 @@ not ok 65 - assertion errors display actual and expected properly not ok 66 - invalid subtest fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:173:7' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/output_cli.snapshot b/test/fixtures/test-runner/output/output_cli.snapshot index fe192625e1f8b6..9a3e4f83274007 100644 --- a/test/fixtures/test-runner/output/output_cli.snapshot +++ b/test/fixtures/test-runner/output/output_cli.snapshot @@ -13,6 +13,7 @@ ok 2 - sync pass todo with message # TODO this is a passing todo not ok 3 - sync fail todo # TODO --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:16:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo' code: 'ERR_TEST_FAILURE' @@ -29,6 +30,7 @@ not ok 3 - sync fail todo # TODO not ok 4 - sync fail todo with message # TODO this is a failing todo --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:21:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo with message' code: 'ERR_TEST_FAILURE' @@ -61,6 +63,7 @@ ok 7 - sync pass not ok 8 - sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:38:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' @@ -87,6 +90,7 @@ ok 10 - async pass not ok 11 - async throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:50:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' @@ -103,6 +107,7 @@ not ok 11 - async throw fail not ok 12 - async skip fail # SKIP --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:54:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' @@ -119,6 +124,7 @@ not ok 12 - async skip fail # SKIP not ok 13 - async assertion fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:59:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -148,6 +154,7 @@ ok 14 - resolve pass not ok 15 - reject fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:68:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' @@ -190,6 +197,7 @@ ok 20 - immediate resolve pass not ok 1 - +sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:101:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' @@ -210,6 +218,7 @@ ok 20 - immediate resolve pass not ok 21 - subtest sync throw fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:100:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -218,6 +227,7 @@ not ok 21 - subtest sync throw fail not ok 22 - sync throw non-error fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:107:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -253,6 +263,7 @@ ok 23 - level 0a not ok 1 - +long running --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:160:5' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -272,6 +283,7 @@ ok 23 - level 0a not ok 24 - top level --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:159:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -295,6 +307,7 @@ ok 27 - sync skip option with message # SKIP this is skipped not ok 28 - sync skip option is false fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:187:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' @@ -377,6 +390,7 @@ ok 41 - callback pass not ok 42 - callback fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:233:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' @@ -403,6 +417,7 @@ ok 45 - callback t is this in test not ok 46 - callback also returns a Promise --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:252:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -411,6 +426,7 @@ not ok 46 - callback also returns a Promise not ok 47 - callback throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:256:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' @@ -427,6 +443,7 @@ not ok 47 - callback throw not ok 48 - callback called twice --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:260:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -443,6 +460,7 @@ ok 49 - callback called twice in different ticks not ok 50 - callback called twice in future tick --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:270:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' @@ -453,6 +471,7 @@ not ok 50 - callback called twice in future tick not ok 51 - callback async throw --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:277:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' @@ -498,6 +517,7 @@ ok 53 - only is set but not in only mode not ok 54 - custom inspect symbol fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:301:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -506,6 +526,7 @@ not ok 54 - custom inspect symbol fail not ok 55 - custom inspect symbol that throws fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:312:1' failureType: 'testCodeFailure' error: |- { @@ -519,6 +540,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 1 - sync throw fails at first --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:324:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' @@ -538,6 +560,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 2 - sync throw fails at second --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:327:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' @@ -557,6 +580,7 @@ not ok 55 - custom inspect symbol that throws fail not ok 56 - subtest sync throw fails --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:323:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -565,6 +589,7 @@ not ok 56 - subtest sync throw fails not ok 57 - timed out async test --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:332:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -573,6 +598,7 @@ not ok 57 - timed out async test not ok 58 - timed out callback test --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:338:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -596,6 +622,7 @@ ok 61 - successful thenable not ok 62 - rejected thenable --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:364:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -604,6 +631,7 @@ not ok 62 - rejected thenable not ok 63 - unfinished test with uncaughtException --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:375:1' failureType: 'uncaughtException' error: 'foo' code: 'ERR_TEST_FAILURE' @@ -616,6 +644,7 @@ not ok 63 - unfinished test with uncaughtException not ok 64 - unfinished test with unhandledRejection --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:381:1' failureType: 'unhandledRejection' error: 'bar' code: 'ERR_TEST_FAILURE' @@ -628,6 +657,7 @@ not ok 64 - unfinished test with unhandledRejection not ok 65 - assertion errors display actual and expected properly --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:393:1' failureType: 'testCodeFailure' error: |- Expected values to be loosely deep-equal: @@ -659,6 +689,7 @@ not ok 65 - assertion errors display actual and expected properly not ok 66 - invalid subtest fail --- duration_ms: * + location: '/test/fixtures/test-runner/output/output.js:173:7' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.snapshot b/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.snapshot index cac7facf893309..aab90a49676024 100644 --- a/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.snapshot +++ b/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.snapshot @@ -9,6 +9,7 @@ gonna timeout not ok 1 - first describe first test --- duration_ms: * + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:17:3' failureType: 'hookFailed' error: 'failed running beforeEach hook' code: 'ERR_TEST_FAILURE' @@ -25,6 +26,7 @@ not ok 1 - before each timeout --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:5:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -36,6 +38,7 @@ not gonna timeout not ok 1 - second describe first test --- duration_ms: * + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:39:3' failureType: 'hookFailed' error: 'failed running afterEach hook' code: 'ERR_TEST_FAILURE' @@ -52,6 +55,7 @@ not ok 2 - after each timeout --- duration_ms: * type: 'suite' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:27:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/unresolved_promise.snapshot b/test/fixtures/test-runner/output/unresolved_promise.snapshot index 4b1593c3365798..8f3f473e75fc37 100644 --- a/test/fixtures/test-runner/output/unresolved_promise.snapshot +++ b/test/fixtures/test-runner/output/unresolved_promise.snapshot @@ -8,6 +8,7 @@ ok 1 - pass not ok 2 - never resolving promise --- duration_ms: * + location: '/test/fixtures/test-runner/output/unresolved_promise.js:6:1' failureType: 'cancelledByParent' error: 'Promise resolution is still pending but the event loop has already resolved' code: 'ERR_TEST_FAILURE' @@ -18,6 +19,7 @@ not ok 2 - never resolving promise not ok 3 - fail --- duration_ms: ZERO + location: '/test/fixtures/test-runner/output/unresolved_promise.js:7:1' failureType: 'cancelledByParent' error: 'Promise resolution is still pending but the event loop has already resolved' code: 'ERR_TEST_FAILURE' diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 8d5233d2de2441..3ba87e78d10013 100644 --- a/test/parallel/test-runner-output.mjs +++ b/test/parallel/test-runner-output.mjs @@ -32,6 +32,7 @@ function removeWindowsPathEscaping(str) { const defaultTransform = snapshot.transform( snapshot.replaceWindowsLineEndings, snapshot.replaceStackTrace, + snapshot.replaceFullPaths, replaceTestDuration, ); const specTransform = snapshot.transform(