diff --git a/test/common/assertSnapshot.js b/test/common/assertSnapshot.js index db3fdde31bec39..c5216c166f0139 100644 --- a/test/common/assertSnapshot.js +++ b/test/common/assertSnapshot.js @@ -7,7 +7,25 @@ const assert = require('node:assert/strict'); const { pathToFileURL } = require('node:url'); const { hostname } = require('node:os'); -const stackFramesRegexp = /(?<=\n)(\s+)((.+?)\s+\()?(?:\(?(.+?):(\d+)(?::(\d+))?)\)?(\s+\{)?(\[\d+m)?(\n|$)/g; +/* eslint-disable @stylistic/js/max-len,no-control-regex */ +/** + * Group 1: Line start (including color codes and escapes) + * Group 2: Function name + * Group 3: Filename + * Group 4: Line number + * Group 5: Column number + * Group 6: Line end (including color codes and `{` which indicates the start of an error object details) + */ +// Mappings: (g1 ) (g2 ) (g3 ) (g4 ) (g5 ) (g6 ) +const internalStackFramesRegexp = /(?<=\n)(\s*(?:\x1b?\[\d+m\s+)?(?:at\s)?)(?:(.+?)\s+\()?(?:(node:.+?):(\d+)(?::(\d+))?)\)?((?:\x1b?\[\d+m)?\s*{?\n|$)/g; +/** + * Group 1: Filename + * Group 2: Line number + * Group 3: Line end and source code line + */ +const internalErrorSourceLines = /(?<=\n|^)(node:.+?):(\d+)(\n.*\n\s*\^(?:\n|$))/g; +/* eslint-enable @stylistic/js/max-len,no-control-regex */ + const windowNewlineRegexp = /\r/g; // Replaces the current Node.js executable version strings with a @@ -17,14 +35,33 @@ function replaceNodeVersion(str) { return str.replaceAll(process.version, ''); } -function replaceStackTrace(str, replacement = '$1*$7$8\n') { - return str.replace(stackFramesRegexp, replacement); +// Collapse consecutive identical lines containing the keyword into +// one single line. The `str` should have been processed by `replaceWindowsLineEndings`. +function foldIdenticalLines(str, keyword) { + const lines = str.split('\n'); + const folded = lines.filter((line, idx) => { + if (idx === 0) { + return true; + } + if (line.includes(keyword) && line === lines[idx - 1]) { + return false; + } + return true; + }); + return folded.join('\n'); } +const kInternalFrame = ''; +// Replace non-internal frame `at TracingChannel.traceSync (node:diagnostics_channel:328:14)` +// as well as `at node:internal/main/run_main_module:33:47` with `at `. +// Also replaces error source line like: +// node:internal/mod.js:44 +// throw err; +// ^ function replaceInternalStackTrace(str) { - // Replace non-internal frame `at TracingChannel.traceSync (node:diagnostics_channel:328:14)` - // as well as `at node:internal/main/run_main_module:33:47` with `*`. - return str.replaceAll(/(\W+).*[(\s]node:.*/g, '$1*'); + const result = str.replaceAll(internalErrorSourceLines, `$1:$3`) + .replaceAll(internalStackFramesRegexp, `$1${kInternalFrame}$6`); + return foldIdenticalLines(result, kInternalFrame); } // Replaces Windows line endings with posix line endings for unified snapshots @@ -73,6 +110,11 @@ function transformProjectRoot(replacement = '') { }; } +// Replaces tmpdirs created by `test/common/tmpdir.js`. +function transformTmpDir(str) { + return str.replaceAll(/\/\.tmp\.\d+\//g, '//'); +} + function transform(...args) { return (str) => args.reduce((acc, fn) => fn(acc), str); } @@ -143,14 +185,10 @@ function replaceTestDuration(str) { } const root = path.resolve(__dirname, '..', '..'); -const color = '(\\[\\d+m)'; -const stackTraceBasePath = new RegExp(`${color}\\(${RegExp.escape(root)}/?${color}(.*)${color}\\)`, 'g'); - function replaceSpecDuration(str) { return str .replaceAll(/[0-9.]+ms/g, '*ms') - .replaceAll(/duration_ms [0-9.]+/g, 'duration_ms *') - .replace(stackTraceBasePath, '$3'); + .replaceAll(/duration_ms [0-9.]+/g, 'duration_ms *'); } function replaceJunitDuration(str) { @@ -158,18 +196,13 @@ function replaceJunitDuration(str) { .replaceAll(/time="[0-9.]+"/g, 'time="*"') .replaceAll(/duration_ms [0-9.]+/g, 'duration_ms *') .replaceAll(`hostname="${hostname()}"`, 'hostname="HOSTNAME"') - .replaceAll(/file="[^"]*"/g, 'file="*"') - .replace(stackTraceBasePath, '$3'); + .replaceAll(/file="[^"]*"/g, 'file="*"'); } function removeWindowsPathEscaping(str) { return common.isWindows ? str.replaceAll(/\\\\/g, '\\') : str; } -function replaceTestLocationLine(str) { - return str.replaceAll(/(js:)(\d+)(:\d+)/g, '$1(LINE)$3'); -} - // The Node test coverage returns results for all files called by the test. This // will make the output file change if files like test/common/index.js change. // This transform picks only the first line and then the lines from the test @@ -188,9 +221,11 @@ function pickTestFileFromLcov(str) { } // Transforms basic patterns like: -// - platform specific path and line endings, -// - line trailing spaces, -// - executable specific path and versions. +// - platform specific path and line endings +// - line trailing spaces +// - executable specific path and versions +// - project root path and tmpdir +// - node internal stack frames const basicTransform = transform( replaceWindowsLineEndings, replaceTrailingSpaces, @@ -199,29 +234,25 @@ const basicTransform = transform( replaceNodeVersion, generalizeExeName, replaceWarningPid, + transformProjectRoot(), + transformTmpDir, + replaceInternalStackTrace, ); const defaultTransform = transform( basicTransform, - replaceStackTrace, - transformProjectRoot(), replaceTestDuration, - replaceTestLocationLine, ); const specTransform = transform( replaceSpecDuration, basicTransform, - replaceStackTrace, ); const junitTransform = transform( replaceJunitDuration, basicTransform, - replaceStackTrace, ); const lcovTransform = transform( basicTransform, - replaceStackTrace, - transformProjectRoot(), pickTestFileFromLcov, ); @@ -240,7 +271,6 @@ module.exports = { assertSnapshot, getSnapshotPath, replaceNodeVersion, - replaceStackTrace, replaceInternalStackTrace, replaceWindowsLineEndings, replaceWindowsPaths, diff --git a/test/fixtures/console/console.snapshot b/test/fixtures/console/console.snapshot index 4f1cb254811b6d..b6106485af1612 100644 --- a/test/fixtures/console/console.snapshot +++ b/test/fixtures/console/console.snapshot @@ -1,9 +1,3 @@ Trace: foo - at * - at * - at * - at * - at * - at * - at * - at * + at Object. (/test/fixtures/console/console.js:5:9) + at diff --git a/test/fixtures/console/stack_overflow.snapshot b/test/fixtures/console/stack_overflow.snapshot index e7e499e308dcb2..2af0ca42092301 100644 --- a/test/fixtures/console/stack_overflow.snapshot +++ b/test/fixtures/console/stack_overflow.snapshot @@ -1,5 +1,5 @@ before -/test/fixtures/console/stack_overflow.js:* +/test/fixtures/console/stack_overflow.js:39 JSON.stringify(array); ^ diff --git a/test/fixtures/errors/async_error_nexttick_main.snapshot b/test/fixtures/errors/async_error_nexttick_main.snapshot index 5f1dbc0d86bea5..a52b5b31440cc5 100644 --- a/test/fixtures/errors/async_error_nexttick_main.snapshot +++ b/test/fixtures/errors/async_error_nexttick_main.snapshot @@ -1,7 +1,7 @@ Error: test at one (/test/fixtures/async-error.js:4:9) at two (/test/fixtures/async-error.js:17:9) - at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at at async three (/test/fixtures/async-error.js:20:3) at async four (/test/fixtures/async-error.js:24:3) at async main (/test/fixtures/errors/async_error_nexttick_main.js:7:5) diff --git a/test/fixtures/errors/core_line_numbers.snapshot b/test/fixtures/errors/core_line_numbers.snapshot index 04fab485252eeb..0a5fc4f8840e97 100644 --- a/test/fixtures/errors/core_line_numbers.snapshot +++ b/test/fixtures/errors/core_line_numbers.snapshot @@ -1,10 +1,9 @@ -node:punycode:54 +node:punycode: throw new RangeError(errors[type]); ^ RangeError: Invalid input - at error (node:punycode:54:8) - at Object.decode (node:punycode:247:5) + at at Object. (/test/fixtures/errors/core_line_numbers.js:13:10) Node.js diff --git a/test/fixtures/errors/error_aggregateTwoErrors.snapshot b/test/fixtures/errors/error_aggregateTwoErrors.snapshot index ab0cafa534db5f..b87c639830cf91 100644 --- a/test/fixtures/errors/error_aggregateTwoErrors.snapshot +++ b/test/fixtures/errors/error_aggregateTwoErrors.snapshot @@ -1,17 +1,17 @@ -/test/fixtures/errors/error_aggregateTwoErrors.js:* +/test/fixtures/errors/error_aggregateTwoErrors.js:15 throw aggregateTwoErrors(err, originalError); ^ AggregateError: original - at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { + at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:15:7) { code: 'ERR0', [errors]: [ Error: original - at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { + at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:9:23) { code: 'ERR0' }, Error: second error - at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { + at Object. (/test/fixtures/errors/error_aggregateTwoErrors.js:10:13) { code: 'ERR1' } ] diff --git a/test/fixtures/errors/error_exit.snapshot b/test/fixtures/errors/error_exit.snapshot index 8bc0bc3da7df3b..f9fa66ff4e1666 100644 --- a/test/fixtures/errors/error_exit.snapshot +++ b/test/fixtures/errors/error_exit.snapshot @@ -1,5 +1,5 @@ Exiting with code=1 -node:internal/assert/utils:* +node:internal/assert/utils: throw error; ^ @@ -7,7 +7,7 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 1 !== 2 - at Object. (/test/fixtures/errors/error_exit.js:*:*) { + at Object. (/test/fixtures/errors/error_exit.js:32:8) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, diff --git a/test/fixtures/errors/error_with_nul.snapshot b/test/fixtures/errors/error_with_nul.snapshot index b60c03fe89cb74..877fb8fa042e72 100644 Binary files a/test/fixtures/errors/error_with_nul.snapshot and b/test/fixtures/errors/error_with_nul.snapshot differ diff --git a/test/fixtures/errors/events_unhandled_error_common_trace.snapshot b/test/fixtures/errors/events_unhandled_error_common_trace.snapshot index 37b3e3b7785874..5c4a3c02d33825 100644 --- a/test/fixtures/errors/events_unhandled_error_common_trace.snapshot +++ b/test/fixtures/errors/events_unhandled_error_common_trace.snapshot @@ -1,12 +1,12 @@ -node:events:* +node:events: throw er; // Unhandled 'error' event ^ Error: foo:bar - at bar (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) - at foo (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) + at bar (/test/fixtures/errors/events_unhandled_error_common_trace.js:9:12) + at foo (/test/fixtures/errors/events_unhandled_error_common_trace.js:12:10) Emitted 'error' event at: - at quux (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) - at Object. (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) + at quux (/test/fixtures/errors/events_unhandled_error_common_trace.js:19:6) + at Object. (/test/fixtures/errors/events_unhandled_error_common_trace.js:22:1) Node.js diff --git a/test/fixtures/errors/events_unhandled_error_nexttick.snapshot b/test/fixtures/errors/events_unhandled_error_nexttick.snapshot index df8940bf9f7721..e789ecab2ab047 100644 --- a/test/fixtures/errors/events_unhandled_error_nexttick.snapshot +++ b/test/fixtures/errors/events_unhandled_error_nexttick.snapshot @@ -1,10 +1,10 @@ -node:events:* +node:events: throw er; // Unhandled 'error' event ^ Error - at Object. (/test/fixtures/errors/events_unhandled_error_nexttick.js:*:*) + at Object. (/test/fixtures/errors/events_unhandled_error_nexttick.js:6:12) Emitted 'error' event at: - at /test/fixtures/errors/events_unhandled_error_nexttick.js:*:* + at /test/fixtures/errors/events_unhandled_error_nexttick.js:8:22 Node.js diff --git a/test/fixtures/errors/events_unhandled_error_sameline.snapshot b/test/fixtures/errors/events_unhandled_error_sameline.snapshot index 700a7ace09c9d0..15e44b748edaff 100644 --- a/test/fixtures/errors/events_unhandled_error_sameline.snapshot +++ b/test/fixtures/errors/events_unhandled_error_sameline.snapshot @@ -1,10 +1,10 @@ -node:events:* +node:events: throw er; // Unhandled 'error' event ^ Error - at Object. (/test/fixtures/errors/events_unhandled_error_sameline.js:*:*) + at Object. (/test/fixtures/errors/events_unhandled_error_sameline.js:6:34) Emitted 'error' event at: - at Object. (/test/fixtures/errors/events_unhandled_error_sameline.js:*:*) + at Object. (/test/fixtures/errors/events_unhandled_error_sameline.js:6:20) Node.js diff --git a/test/fixtures/errors/events_unhandled_error_subclass.snapshot b/test/fixtures/errors/events_unhandled_error_subclass.snapshot index a1c2c0485aa4fc..1584badd956515 100644 --- a/test/fixtures/errors/events_unhandled_error_subclass.snapshot +++ b/test/fixtures/errors/events_unhandled_error_subclass.snapshot @@ -1,10 +1,10 @@ -node:events:* +node:events: throw er; // Unhandled 'error' event ^ Error - at Object. (/test/fixtures/errors/events_unhandled_error_subclass.js:*:*) + at Object. (/test/fixtures/errors/events_unhandled_error_subclass.js:7:25) Emitted 'error' event on Foo instance at: - at Object. (/test/fixtures/errors/events_unhandled_error_subclass.js:*:*) + at Object. (/test/fixtures/errors/events_unhandled_error_subclass.js:7:11) Node.js diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot index dd673d0bf9660f..5503072ab10f74 100644 --- a/test/fixtures/errors/force_colors.snapshot +++ b/test/fixtures/errors/force_colors.snapshot @@ -4,12 +4,6 @@ throw new Error('Should include grayed stack trace'); Error: Should include grayed stack trace at Object. (/test/fixtures/errors/force_colors.js:2:7) - at * - at * - at * - at * - at * - at * - at * + at  Node.js diff --git a/test/fixtures/errors/if-error-has-good-stack.snapshot b/test/fixtures/errors/if-error-has-good-stack.snapshot index 923e687c071315..91b7605d8f0ff4 100644 --- a/test/fixtures/errors/if-error-has-good-stack.snapshot +++ b/test/fixtures/errors/if-error-has-good-stack.snapshot @@ -1,23 +1,23 @@ -node:assert:* +node:assert: throw newErr; ^ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - at z (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at y (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at x (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at Object. (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at c (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at b (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at a (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at Object. (/test/fixtures/errors/if-error-has-good-stack.js:*:*) { + at z (/test/fixtures/errors/if-error-has-good-stack.js:21:14) + at y (/test/fixtures/errors/if-error-has-good-stack.js:22:7) + at x (/test/fixtures/errors/if-error-has-good-stack.js:23:5) + at Object. (/test/fixtures/errors/if-error-has-good-stack.js:24:3) + at c (/test/fixtures/errors/if-error-has-good-stack.js:13:13) + at b (/test/fixtures/errors/if-error-has-good-stack.js:14:7) + at a (/test/fixtures/errors/if-error-has-good-stack.js:15:5) + at Object. (/test/fixtures/errors/if-error-has-good-stack.js:16:3) { generatedMessage: false, code: 'ERR_ASSERTION', actual: Error: test error - at c (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at b (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at a (/test/fixtures/errors/if-error-has-good-stack.js:*:*) - at Object. (/test/fixtures/errors/if-error-has-good-stack.js:*:*), + at c (/test/fixtures/errors/if-error-has-good-stack.js:13:13) + at b (/test/fixtures/errors/if-error-has-good-stack.js:14:7) + at a (/test/fixtures/errors/if-error-has-good-stack.js:15:5) + at Object. (/test/fixtures/errors/if-error-has-good-stack.js:16:3), expected: null, operator: 'ifError', diff: 'simple' diff --git a/test/fixtures/errors/promise_always_throw_unhandled.snapshot b/test/fixtures/errors/promise_always_throw_unhandled.snapshot index bd4fe396d898e8..6ced213b1b4db9 100644 --- a/test/fixtures/errors/promise_always_throw_unhandled.snapshot +++ b/test/fixtures/errors/promise_always_throw_unhandled.snapshot @@ -1,17 +1,11 @@ -/test/fixtures/errors/promise_always_throw_unhandled.js:* +/test/fixtures/errors/promise_always_throw_unhandled.js:10 throw new Error('One'); ^ Error: One - at * + at /test/fixtures/errors/promise_always_throw_unhandled.js:10:9 at new Promise () - at * - at * - at * - at * - at * - at * - at * - at * + at Object. (/test/fixtures/errors/promise_always_throw_unhandled.js:9:14) + at Node.js diff --git a/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot b/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot index 8a260ab7dfb098..a2a4cb644b586b 100644 --- a/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot +++ b/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot @@ -1,11 +1,5 @@ (node:) UnhandledPromiseRejectionWarning: Error: alas - at * - at * - at * - at * - at * - at * - at * - at * + at Object. (/test/fixtures/errors/promise_unhandled_warn_with_error.js:7:16) + at (Use ` --trace-warnings ...` to show where the warning was created) (node:) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) diff --git a/test/fixtures/errors/throw_custom_error.snapshot b/test/fixtures/errors/throw_custom_error.snapshot index efaf2d6f8aed27..22d5a9de733650 100644 --- a/test/fixtures/errors/throw_custom_error.snapshot +++ b/test/fixtures/errors/throw_custom_error.snapshot @@ -1,5 +1,5 @@ -/test/fixtures/errors/throw_custom_error.js:* +/test/fixtures/errors/throw_custom_error.js:27 throw ({ name: 'MyCustomError', message: 'This is a custom message' }); ^ { name: 'MyCustomError', message: 'This is a custom message' } diff --git a/test/fixtures/errors/throw_error_with_getter_throw.snapshot b/test/fixtures/errors/throw_error_with_getter_throw.snapshot index 5c4281c4769b66..9212c17f6cd574 100644 --- a/test/fixtures/errors/throw_error_with_getter_throw.snapshot +++ b/test/fixtures/errors/throw_error_with_getter_throw.snapshot @@ -1,5 +1,5 @@ -/test/fixtures/errors/throw_error_with_getter_throw.js:* +/test/fixtures/errors/throw_error_with_getter_throw.js:3 throw { // eslint-disable-line no-throw-literal ^ [object Object] diff --git a/test/fixtures/errors/throw_in_eval_anonymous.snapshot b/test/fixtures/errors/throw_in_eval_anonymous.snapshot index 47305671b1bc71..607e7f81d2cd9b 100644 --- a/test/fixtures/errors/throw_in_eval_anonymous.snapshot +++ b/test/fixtures/errors/throw_in_eval_anonymous.snapshot @@ -1,8 +1,8 @@ -:* +:3 throw new Error('error in anonymous script'); ^ Error: error in anonymous script - at eval (eval at (/test/fixtures/errors/throw_in_eval_anonymous.js:*:*), :*:*) + at eval (eval at (/test/fixtures/errors/throw_in_eval_anonymous.js:5:1), :3:9) Node.js diff --git a/test/fixtures/errors/throw_in_eval_named.snapshot b/test/fixtures/errors/throw_in_eval_named.snapshot index 4677dd195ab38c..cfe6295f36da31 100644 --- a/test/fixtures/errors/throw_in_eval_named.snapshot +++ b/test/fixtures/errors/throw_in_eval_named.snapshot @@ -1,8 +1,8 @@ -evalscript.js:* +evalscript.js:3 throw new Error('error in named script'); ^ Error: error in named script - at eval (evalscript.js:*:*) + at eval (evalscript.js:3:9) Node.js diff --git a/test/fixtures/errors/throw_in_line_with_tabs.snapshot b/test/fixtures/errors/throw_in_line_with_tabs.snapshot index b5cb8e99cd3130..24dac9786edb8a 100644 --- a/test/fixtures/errors/throw_in_line_with_tabs.snapshot +++ b/test/fixtures/errors/throw_in_line_with_tabs.snapshot @@ -1,6 +1,6 @@ before -/test/fixtures/errors/throw_in_line_with_tabs.js:* +/test/fixtures/errors/throw_in_line_with_tabs.js:31 throw ({ foo: 'bar' }); ^ { foo: 'bar' } diff --git a/test/fixtures/errors/throw_non_error.snapshot b/test/fixtures/errors/throw_non_error.snapshot index 55f213290b8a85..4da670f95c64f6 100644 --- a/test/fixtures/errors/throw_non_error.snapshot +++ b/test/fixtures/errors/throw_non_error.snapshot @@ -1,5 +1,5 @@ -/test/fixtures/errors/throw_non_error.js:* +/test/fixtures/errors/throw_non_error.js:27 throw ({ foo: 'bar' }); ^ { foo: 'bar' } diff --git a/test/fixtures/errors/throw_null.snapshot b/test/fixtures/errors/throw_null.snapshot index dd535b524ff061..d0a5b499789e1d 100644 --- a/test/fixtures/errors/throw_null.snapshot +++ b/test/fixtures/errors/throw_null.snapshot @@ -1,5 +1,5 @@ -/test/fixtures/errors/throw_null.js:* +/test/fixtures/errors/throw_null.js:26 throw null; ^ null diff --git a/test/fixtures/errors/throw_undefined.snapshot b/test/fixtures/errors/throw_undefined.snapshot index f1b12ae7563a87..71e329e69d6d89 100644 --- a/test/fixtures/errors/throw_undefined.snapshot +++ b/test/fixtures/errors/throw_undefined.snapshot @@ -1,5 +1,5 @@ -/test/fixtures/errors/throw_undefined.js:* +/test/fixtures/errors/throw_undefined.js:26 throw undefined; ^ undefined diff --git a/test/fixtures/errors/timeout_throw.snapshot b/test/fixtures/errors/timeout_throw.snapshot index 5ad384ab43f329..e823593a6a80a8 100644 --- a/test/fixtures/errors/timeout_throw.snapshot +++ b/test/fixtures/errors/timeout_throw.snapshot @@ -1,10 +1,9 @@ -/test/fixtures/errors/timeout_throw.js:* +/test/fixtures/errors/timeout_throw.js:27 undefined_reference_error_maker; ^ ReferenceError: undefined_reference_error_maker is not defined - at Timeout._onTimeout (/test/fixtures/errors/timeout_throw.js:*:*) - at listOnTimeout (node:internal/timers:*:*) - at process.processTimers (node:internal/timers:*:*) + at Timeout._onTimeout (/test/fixtures/errors/timeout_throw.js:27:3) + at Node.js diff --git a/test/fixtures/errors/undefined_reference_in_new_context.snapshot b/test/fixtures/errors/undefined_reference_in_new_context.snapshot index 50b6f8e7f329ff..c8b240a94e36f9 100644 --- a/test/fixtures/errors/undefined_reference_in_new_context.snapshot +++ b/test/fixtures/errors/undefined_reference_in_new_context.snapshot @@ -1,13 +1,11 @@ before -evalmachine.:* +evalmachine.:1 Error.stackTraceLimit = 5; foo.bar = 5; ^ ReferenceError: foo is not defined - at evalmachine.:*:* - at Script.runInContext (node:vm:*:*) - at Script.runInNewContext (node:vm:*:*) - at Object.runInNewContext (node:vm:*:*) - at Object. (/test/fixtures/errors/undefined_reference_in_new_context.js:*:*) + at evalmachine.:1:28 + at + at Object. (/test/fixtures/errors/undefined_reference_in_new_context.js:29:4) Node.js diff --git a/test/fixtures/errors/unhandled_promise_trace_warnings.snapshot b/test/fixtures/errors/unhandled_promise_trace_warnings.snapshot index b0af9d31a97b48..d434f6d3f13276 100644 --- a/test/fixtures/errors/unhandled_promise_trace_warnings.snapshot +++ b/test/fixtures/errors/unhandled_promise_trace_warnings.snapshot @@ -1,29 +1,12 @@ (node:) UnhandledPromiseRejectionWarning: Error: This was rejected - at * - at * - at * - at * - at * - at * - at * - at * - at * - at * - at * - at * + at Object. (/test/fixtures/errors/unhandled_promise_trace_warnings.js:4:26) + at (node:) Error: This was rejected - at * - at * - at * - at * - at * - at * - at * - at * + at Object. (/test/fixtures/errors/unhandled_promise_trace_warnings.js:4:26) + at (node:) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) - at * - at * + at at Promise.then () at Promise.catch () - at * - at * + at Immediate. (/test/fixtures/errors/unhandled_promise_trace_warnings.js:5:27) + at diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot index 615a05089449a1..900569324f65fd 100644 --- a/test/fixtures/eval/eval_messages.snapshot +++ b/test/fixtures/eval/eval_messages.snapshot @@ -5,10 +5,7 @@ with(this){__filename} The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. SyntaxError: Strict mode code may not include a with statement - - - - + at Node.js 42 @@ -18,14 +15,10 @@ throw new Error("hello") ^ Error: hello - - - - - - - - + at [eval]:1:7 + at + at [eval]-wrapper:6:24 + at Node.js [eval]:1 @@ -33,14 +26,10 @@ throw new Error("hello") ^ Error: hello - - - - - - - - + at [eval]:1:7 + at + at [eval]-wrapper:6:24 + at Node.js 100 @@ -49,14 +38,10 @@ var x = 100; y = x; ^ ReferenceError: y is not defined - - - - - - - - + at [eval]:1:16 + at + at [eval]-wrapper:6:24 + at Node.js diff --git a/test/fixtures/eval/eval_typescript.snapshot b/test/fixtures/eval/eval_typescript.snapshot index 49c034895ed92d..7d57ab541cd184 100644 --- a/test/fixtures/eval/eval_typescript.snapshot +++ b/test/fixtures/eval/eval_typescript.snapshot @@ -4,10 +4,7 @@ enum Foo{}; TypeScript enum is not supported in strip-only mode SyntaxError: Unexpected reserved word - - - - + at Node.js [eval]:1 @@ -15,14 +12,10 @@ throw new SyntaxError("hello") ^ SyntaxError: hello - - - - - - - - + at [eval]:1:7 + at + at [eval]-wrapper:6:24 + at Node.js [eval]:1 @@ -31,10 +24,7 @@ const foo; 'const' declarations must be initialized SyntaxError: Missing initializer in const declaration - - - - + at Node.js 100 @@ -46,10 +36,7 @@ interface Foo{};const foo; 'const' declarations must be initialized SyntaxError: Unexpected identifier 'Foo' - - - - + at Node.js [eval]:1 @@ -58,9 +45,6 @@ function foo(){ await Promise.resolve(1)}; await isn't allowed in non-async function SyntaxError: await is only valid in async functions and the top level bodies of modules - - - - + at Node.js diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot index 9710f6871583c4..fff0d2e9fcc926 100644 --- a/test/fixtures/eval/stdin_messages.snapshot +++ b/test/fixtures/eval/stdin_messages.snapshot @@ -5,14 +5,7 @@ with(this){__filename} The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. SyntaxError: Strict mode code may not include a with statement - - - - - - - - + at Node.js 42 @@ -22,16 +15,10 @@ throw new Error("hello") ^ Error: hello - - - - - - - - - - + at [stdin]:1:7 + at + at [stdin]-wrapper:6:24 + at Node.js [stdin]:1 @@ -39,16 +26,10 @@ throw new Error("hello") ^ Error: hello - - - - - - - - - - + at [stdin]:1:7 + at + at [stdin]-wrapper:6:24 + at Node.js 100 @@ -57,16 +38,10 @@ let x = 100; y = x; ^ ReferenceError: y is not defined - - - - - - - - - - + at [stdin]:1:16 + at + at [stdin]-wrapper:6:24 + at Node.js diff --git a/test/fixtures/eval/stdin_typescript.snapshot b/test/fixtures/eval/stdin_typescript.snapshot index 7bf7fbaa3bfb97..73d9f714b6aaef 100644 --- a/test/fixtures/eval/stdin_typescript.snapshot +++ b/test/fixtures/eval/stdin_typescript.snapshot @@ -4,14 +4,7 @@ enum Foo{}; TypeScript enum is not supported in strip-only mode SyntaxError: Unexpected reserved word - - - - - - - - + at Node.js [stdin]:1 @@ -20,14 +13,7 @@ enum Foo{}; TypeScript enum is not supported in strip-only mode SyntaxError: Unexpected reserved word - - - - - - - - + at Node.js [stdin]:1 @@ -35,16 +21,10 @@ throw new SyntaxError("hello") ^ SyntaxError: hello - - - - - - - - - - + at [stdin]:1:7 + at + at [stdin]-wrapper:6:24 + at Node.js [stdin]:1 @@ -52,16 +32,10 @@ throw new SyntaxError("hello") ^ SyntaxError: hello - - - - - - - - - - + at [stdin]:1:7 + at + at [stdin]-wrapper:6:24 + at Node.js [stdin]:1 @@ -70,14 +44,7 @@ const foo; 'const' declarations must be initialized SyntaxError: Missing initializer in const declaration - - - - - - - - + at Node.js [stdin]:1 @@ -86,14 +53,7 @@ const foo; 'const' declarations must be initialized SyntaxError: Missing initializer in const declaration - - - - - - - - + at Node.js 100 @@ -108,14 +68,7 @@ interface Foo{};const foo; 'const' declarations must be initialized SyntaxError: Unexpected identifier 'Foo' - - - - - - - - + at Node.js [stdin]:1 @@ -124,14 +77,7 @@ interface Foo{};const foo; 'const' declarations must be initialized SyntaxError: Unexpected strict mode reserved word - - - - - - - - + at Node.js [stdin]:1 @@ -140,14 +86,7 @@ function foo(){ await Promise.resolve(1)}; await isn't allowed in non-async function SyntaxError: await is only valid in async functions and the top level bodies of modules - - - - - - - - + at Node.js [stdin]:1 @@ -156,14 +95,7 @@ function foo(){ await Promise.resolve(1)}; await isn't allowed in non-async function SyntaxError: await is only valid in async functions and the top level bodies of modules - - - - - - - - + at Node.js done diff --git a/test/fixtures/source-map/output/source_map_assert_source_line.snapshot b/test/fixtures/source-map/output/source_map_assert_source_line.snapshot index d20e19d9fe3870..3bc9661920fd59 100644 --- a/test/fixtures/source-map/output/source_map_assert_source_line.snapshot +++ b/test/fixtures/source-map/output/source_map_assert_source_line.snapshot @@ -3,13 +3,8 @@ AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: assert(false) at Object. (/test/fixtures/source-map/output/source_map_assert_source_line.ts:11:3) - * - * - * - * - * - * - * + at + at { generatedMessage: true, code: 'ERR_ASSERTION', actual: false, diff --git a/test/fixtures/source-map/output/source_map_sourcemapping_url_string.snapshot b/test/fixtures/source-map/output/source_map_sourcemapping_url_string.snapshot index 8ebf9af22e9d09..148d1b8190dd08 100644 --- a/test/fixtures/source-map/output/source_map_sourcemapping_url_string.snapshot +++ b/test/fixtures/source-map/output/source_map_sourcemapping_url_string.snapshot @@ -1,3 +1,3 @@ Error: an exception. at Object. (/test/fixtures/source-map/typescript-sourcemapping_url_string.ts:3:7) - * + at diff --git a/test/fixtures/source-map/output/source_map_throw_construct.snapshot b/test/fixtures/source-map/output/source_map_throw_construct.snapshot index 43718adba6a306..824a374747d0b5 100644 --- a/test/fixtures/source-map/output/source_map_throw_construct.snapshot +++ b/test/fixtures/source-map/output/source_map_throw_construct.snapshot @@ -5,8 +5,6 @@ Error: message at new Foo (/test/fixtures/source-map/output/source_map_throw_construct.mts:13:11) at (/test/fixtures/source-map/output/source_map_throw_construct.mts:17:1) - * - * - * + at Node.js diff --git a/test/fixtures/source-map/output/source_map_throw_set_immediate.snapshot b/test/fixtures/source-map/output/source_map_throw_set_immediate.snapshot index 999258182a6152..461fb3b034ef88 100644 --- a/test/fixtures/source-map/output/source_map_throw_set_immediate.snapshot +++ b/test/fixtures/source-map/output/source_map_throw_set_immediate.snapshot @@ -5,6 +5,6 @@ Error: goodbye at Hello (/test/fixtures/source-map/uglify-throw-original.js:5:9) at Immediate. (/test/fixtures/source-map/uglify-throw-original.js:9:3) - * + at Node.js diff --git a/test/fixtures/test-runner/output/abort-runs-after-hook.snapshot b/test/fixtures/test-runner/output/abort-runs-after-hook.snapshot index f551a0b5baab75..44643bfcb7c3cf 100644 --- a/test/fixtures/test-runner/output/abort-runs-after-hook.snapshot +++ b/test/fixtures/test-runner/output/abort-runs-after-hook.snapshot @@ -5,13 +5,13 @@ not ok 1 - test that aborts --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort-runs-after-hook.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort-runs-after-hook.js:4:1' failureType: 'uncaughtException' error: 'boom' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/abort-runs-after-hook.js:12:11) + ... 1..1 # tests 1 diff --git a/test/fixtures/test-runner/output/abort.snapshot b/test/fixtures/test-runner/output/abort.snapshot index c8e9aeb31b5faa..72504832704c80 100644 --- a/test/fixtures/test-runner/output/abort.snapshot +++ b/test/fixtures/test-runner/output/abort.snapshot @@ -29,7 +29,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):7' + 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' @@ -39,7 +39,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):7' + 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' @@ -49,104 +49,67 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):7' + location: '/test/fixtures/test-runner/output/abort.js:13:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 4 not ok 8 - not ok 4 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):7' + location: '/test/fixtures/test-runner/output/abort.js:14:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 5 not ok 9 - not ok 5 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):7' + location: '/test/fixtures/test-runner/output/abort.js:15:7' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... 1..9 not ok 1 - promise timeout signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort.js:5:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 name: 'TimeoutError' stack: |- - * - * - * - * + ... # Subtest: promise abort signal not ok 2 - promise abort signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort.js:21:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + Object. (/test/fixtures/test-runner/output/abort.js:21:52) + ... # Subtest: callback timeout signal # Subtest: ok 1 @@ -178,7 +141,7 @@ not ok 2 - promise abort signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):5' + 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' @@ -188,7 +151,7 @@ not ok 2 - promise abort signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):5' + 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' @@ -198,104 +161,67 @@ not ok 2 - promise abort signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):5' + location: '/test/fixtures/test-runner/output/abort.js:32:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 4 not ok 8 - not ok 4 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):5' + location: '/test/fixtures/test-runner/output/abort.js:33:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 5 not ok 9 - not ok 5 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):5' + location: '/test/fixtures/test-runner/output/abort.js:34:5' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... 1..9 not ok 3 - callback timeout signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort.js:25:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 name: 'TimeoutError' stack: |- - * - * - * - * + ... # Subtest: callback abort signal not ok 4 - callback abort signal --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort.js:39:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + Object. (/test/fixtures/test-runner/output/abort.js:39:53) + ... 1..4 # tests 22 diff --git a/test/fixtures/test-runner/output/abort_hooks.snapshot b/test/fixtures/test-runner/output/abort_hooks.snapshot index db52ca3c8fbbb0..10a9c189e7885c 100644 --- a/test/fixtures/test-runner/output/abort_hooks.snapshot +++ b/test/fixtures/test-runner/output/abort_hooks.snapshot @@ -13,7 +13,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + 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' @@ -23,7 +23,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + 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' @@ -33,22 +33,15 @@ not ok 1 - 1 before describe --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort_hooks.js:4:1' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + before.signal (/test/fixtures/test-runner/output/abort_hooks.js:8:8) + ... # Subtest: 2 after describe # Subtest: test 1 @@ -68,22 +61,15 @@ not ok 2 - 2 after describe --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort_hooks.js:19:1' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + after.signal (/test/fixtures/test-runner/output/abort_hooks.js:23:8) + ... # Subtest: 3 beforeEach describe # Subtest: test 1 @@ -91,51 +77,37 @@ not ok 2 - 2 after describe --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_hooks.js:41:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + beforeEach.signal (/test/fixtures/test-runner/output/abort_hooks.js:38:8) + ... # Subtest: test 2 not ok 2 - test 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_hooks.js:44:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + beforeEach.signal (/test/fixtures/test-runner/output/abort_hooks.js:38:8) + ... 1..2 not ok 3 - 3 beforeEach describe --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort_hooks.js:34:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -146,51 +118,37 @@ not ok 3 - 3 beforeEach describe --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_hooks.js:56:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + afterEach.signal (/test/fixtures/test-runner/output/abort_hooks.js:53:8) + ... # Subtest: test 2 not ok 2 - test 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_hooks.js:59:3' failureType: 'hookFailed' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + afterEach.signal (/test/fixtures/test-runner/output/abort_hooks.js:53:8) + ... 1..2 not ok 4 - 4 afterEach describe --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_hooks.js:(LINE):1' + 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 80a7705e92959b..0f1a1710c77d88 100644 --- a/test/fixtures/test-runner/output/abort_suite.snapshot +++ b/test/fixtures/test-runner/output/abort_suite.snapshot @@ -29,7 +29,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):3' + 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' @@ -39,7 +39,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):3' + 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' @@ -49,104 +49,67 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_suite.js:12:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 4 not ok 8 - not ok 4 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_suite.js:13:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... # Subtest: not ok 5 not ok 9 - not ok 5 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):3' + location: '/test/fixtures/test-runner/output/abort_suite.js:14:3' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + ... 1..9 not ok 1 - describe timeout signal --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort_suite.js:5:1' failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 name: 'TimeoutError' stack: |- - * - * - * - * + ... # Subtest: describe abort signal not ok 2 - describe abort signal --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/abort_suite.js:(LINE):1' + location: '/test/fixtures/test-runner/output/abort_suite.js:19:1' failureType: 'testAborted' error: 'This operation was aborted' code: 20 name: 'AbortError' stack: |- - * - * - * - * - * - * - * - * - * - * + + Object. (/test/fixtures/test-runner/output/abort_suite.js:19:57) + ... 1..2 # tests 9 diff --git a/test/fixtures/test-runner/output/assertion-color-tty.snapshot b/test/fixtures/test-runner/output/assertion-color-tty.snapshot index 56def5cdaa5f79..1489619e4e7cd2 100644 --- a/test/fixtures/test-runner/output/assertion-color-tty.snapshot +++ b/test/fixtures/test-runner/output/assertion-color-tty.snapshot @@ -10,7 +10,7 @@ [31m✖ failing tests:[39m -* +test at test/fixtures/test-runner/output/assertion-color-tty.mjs:4:1 [31m✖ failing assertion [90m(*ms)[39m[39m [AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: [32mactual[39m [31mexpected[39m diff --git a/test/fixtures/test-runner/output/default_output.snapshot b/test/fixtures/test-runner/output/default_output.snapshot index a58e14346ec727..55b40367282366 100644 --- a/test/fixtures/test-runner/output/default_output.snapshot +++ b/test/fixtures/test-runner/output/default_output.snapshot @@ -16,27 +16,16 @@ [31m✖ failing tests:[39m -* +test at test/fixtures/test-runner/output/default_output.js:10:1 [31m✖ should fail [90m(*ms)[39m[39m Error: fail - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m + at TestContext. [90m(/[39mtest/fixtures/test-runner/output/default_output.js:10:35[90m)[39m + [90m at [39m -* +test at test/fixtures/test-runner/output/default_output.js:13:5 [31m✖ should fail [90m(*ms)[39m[39m Error: fail - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m - *[39m + at TestContext. [90m(/[39mtest/fixtures/test-runner/output/default_output.js:13:39[90m)[39m + [90m at [39m + at TestContext. [90m(/[39mtest/fixtures/test-runner/output/default_output.js:13:5[90m)[39m + [90m at [39m diff --git a/test/fixtures/test-runner/output/describe_it.snapshot b/test/fixtures/test-runner/output/describe_it.snapshot index f1240a6a99dafc..9be9d988f0ffa9 100644 --- a/test/fixtures/test-runner/output/describe_it.snapshot +++ b/test/fixtures/test-runner/output/describe_it.snapshot @@ -40,18 +40,13 @@ not ok 7 - sync todo # TODO --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):4' + location: '/test/fixtures/test-runner/output/describe_it.js:30:4' failureType: 'testCodeFailure' error: 'should not count as a failure' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:31:9) + ... # Subtest: sync todo with expect fail ok 8 - sync todo with expect fail # TODO @@ -64,18 +59,13 @@ not ok 9 - sync todo with message # TODO this is a failing todo --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:38:1' failureType: 'testCodeFailure' error: 'should not count as a failure' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:39:9) + ... # Subtest: sync skip pass ok 10 - sync skip pass # SKIP @@ -106,18 +96,13 @@ not ok 14 - sync throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:55:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:56:9) + ... # Subtest: async skip pass ok 15 - async skip pass # SKIP @@ -142,25 +127,20 @@ not ok 18 - async throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:68:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:69:9) + ... # Subtest: async skip fail not ok 19 - async skip fail # SKIP --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:72:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -170,7 +150,7 @@ not ok 20 - async assertion fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:77:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -183,13 +163,8 @@ not ok 20 - async assertion fail actual: true operator: 'strictEqual' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:79:10) + ... # Subtest: resolve pass ok 21 - resolve pass @@ -202,18 +177,13 @@ not ok 22 - reject fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:86:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:87:25) + ... # Subtest: unhandled rejection - passes but warns ok 23 - unhandled rejection - passes but warns @@ -251,20 +221,15 @@ ok 27 - immediate resolve pass --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:119:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:120:11) + new Promise () - * - * + Array.map () ... # Subtest: mixing describe/it and test should work @@ -278,7 +243,7 @@ not ok 28 - subtest sync throw fail --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:118:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -288,7 +253,7 @@ not ok 29 - sync throw non-error fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:125:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -347,18 +312,13 @@ not ok 34 - sync skip option is false fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:194:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:195:9) + ... # Subtest: ok 35 - @@ -419,13 +379,13 @@ not ok 44 - callback fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:226:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/describe_it.js:228:10) + ... # Subtest: sync t is this in test ok 45 - sync t is this in test @@ -450,7 +410,7 @@ not ok 48 - callback also returns a Promise --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:245:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -460,31 +420,26 @@ not ok 49 - callback throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:249:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:250:9) + ... # Subtest: callback called twice not ok 50 - callback called twice --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:253:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:255:3) + ... # Subtest: callback called twice in different ticks ok 51 - callback called twice in different ticks @@ -497,25 +452,25 @@ not ok 52 - callback called twice in future tick --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:263:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/describe_it.js:266:5) ... # Subtest: callback async throw not ok 53 - callback async throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:270:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/describe_it.js:272:11) + ... # Subtest: callback async throw after done ok 54 - callback async throw after done @@ -528,7 +483,7 @@ not ok 55 - custom inspect symbol fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:284:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -538,7 +493,7 @@ not ok 56 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:295:1' failureType: 'testCodeFailure' error: |- { @@ -553,20 +508,15 @@ not ok 56 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:307:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:308:11) + new Promise () - * - * + Array.map () ... # Subtest: sync throw fails at second @@ -574,27 +524,22 @@ not ok 56 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:310:3' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/describe_it.js:311:11) + async Promise.all (index 0) - * - * + ... 1..2 not ok 57 - subtest sync throw fails --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:306:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -605,7 +550,7 @@ not ok 57 - subtest sync throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:316:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -615,21 +560,15 @@ not ok 58 - describe sync throw fails --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:315:1' failureType: 'testCodeFailure' error: 'thrown from describe' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/describe_it.js:317:9) + + Object. (/test/fixtures/test-runner/output/describe_it.js:315:1) + ... # Subtest: describe async throw fails # Subtest: should not run @@ -637,7 +576,7 @@ not ok 58 - describe sync throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:321:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -647,21 +586,15 @@ not ok 59 - describe async throw fails --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:320:1' failureType: 'testCodeFailure' error: 'thrown from describe' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/describe_it.js:322:9) + + Object. (/test/fixtures/test-runner/output/describe_it.js:320:1) + ... # Subtest: timeouts # Subtest: timed out async test @@ -669,7 +602,7 @@ not ok 59 - describe async throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:326:3' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -681,7 +614,7 @@ not ok 59 - describe async throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:335:3' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -703,7 +636,7 @@ not ok 60 - timeouts --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:325:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -720,21 +653,20 @@ not ok 60 - timeouts --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):3' + location: '/test/fixtures/test-runner/output/describe_it.js:366:3' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * + Object. (/test/fixtures/test-runner/output/describe_it.js:372:50) + ... 1..2 not ok 61 - successful thenable --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:354:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -744,13 +676,13 @@ not ok 62 - rejected thenable --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1' + location: '/test/fixtures/test-runner/output/describe_it.js:387:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Object. (/test/fixtures/test-runner/output/describe_it.js:393:48) + ... # Subtest: async describe function # Subtest: it inside describe 1 @@ -789,20 +721,20 @@ not ok 64 - invalid subtest fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):5' + location: '/test/fixtures/test-runner/output/describe_it.js:180:5' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/describe_it.js:180:5) ... 1..64 -# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/describe_it.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/describe_it.js:90:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/describe_it.js:94:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/describe_it.js:98:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/describe_it.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/describe_it.js:258:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/describe_it.js:276:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. # tests 73 # suites 11 # pass 35 diff --git a/test/fixtures/test-runner/output/dot_reporter.snapshot b/test/fixtures/test-runner/output/dot_reporter.snapshot index 9d36767c415586..f3335117acf884 100644 --- a/test/fixtures/test-runner/output/dot_reporter.snapshot +++ b/test/fixtures/test-runner/output/dot_reporter.snapshot @@ -8,61 +8,32 @@ Failed tests: ⚠ sync fail todo (*ms) # TODO Error: thrown from sync fail todo - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:42:9) + at ⚠ sync fail todo with message (*ms) # this is a failing todo Error: thrown from sync fail todo with message - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:47:9) + at ✖ sync throw fail (*ms) Error: thrown from sync throw fail - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:63:9) + at ✖ async throw fail (*ms) Error: thrown from async throw fail - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:75:9) + at ﹣ async skip fail (*ms) # SKIP Error: thrown from async throw fail - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:80:9) + at ✖ async assertion fail (*ms) AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: true !== false - * - * - * - * - * - * - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:85:10) + at + at { generatedMessage: true, code: 'ERR_ASSERTION', actual: true, @@ -72,92 +43,61 @@ Failed tests: } ✖ reject fail (*ms) Error: rejected from reject fail - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:93:25) + at ✖ +sync throw fail (*ms) Error: thrown from subtest sync throw fail - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:127:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:125:11) + at ✖ subtest sync throw fail (*ms) '1 subtest failed' ✖ sync throw non-error fail (*ms) Symbol(thrown symbol from sync throw non-error fail) ✖ sync skip option is false fail (*ms) Error: this should be executed - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:212:9) + at ✖ callback fail (*ms) Error: callback failure - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:245:10) + at ✖ callback also returns a Promise (*ms) 'passed a callback but also returned a Promise' ✖ callback throw (*ms) Error: thrown from callback throw - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:267:9) + at ✖ callback called twice (*ms) 'callback invoked multiple times' ✖ callback called twice in future tick (*ms) Error [ERR_TEST_FAILURE]: callback invoked multiple times - * { + at Immediate. (/test/fixtures/test-runner/output/output.js:283:5) { code: 'ERR_TEST_FAILURE', failureType: 'multipleCallbackInvocations', cause: 'callback invoked multiple times' } ✖ callback async throw (*ms) Error: thrown from callback async throw - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:289:11) + at ✖ custom inspect symbol fail (*ms) customized ✖ custom inspect symbol that throws fail (*ms) { foo: 1, Symbol(nodejs.util.inspect.custom): [Function: [nodejs.util.inspect.custom]] } ✖ sync throw fails at first (*ms) Error: thrown from subtest sync throw fails at first - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:335:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:334:11) + at ✖ sync throw fails at second (*ms) Error: thrown from subtest sync throw fails at second - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/output.js:338:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:337:11) + at ✖ subtest sync throw fails (*ms) '2 subtests failed' ✖ timed out async test (*ms) @@ -168,14 +108,12 @@ Failed tests: 'custom error' ✖ unfinished test with uncaughtException (*ms) Error: foo - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + at ✖ unfinished test with unhandledRejection (*ms) Error: bar - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + at ✖ assertion errors display actual and expected properly (*ms) AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal: @@ -212,7 +150,7 @@ Failed tests: c: [Circular *1] } } - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:425:12) { generatedMessage: true, code: 'ERR_ASSERTION', actual: [Object], diff --git a/test/fixtures/test-runner/output/eval_dot.snapshot b/test/fixtures/test-runner/output/eval_dot.snapshot index 8a22cfd477b15d..cb0cd1cbf9be0e 100644 --- a/test/fixtures/test-runner/output/eval_dot.snapshot +++ b/test/fixtures/test-runner/output/eval_dot.snapshot @@ -4,10 +4,5 @@ Failed tests: ✖ fails (*ms) Error: fail - * - * - * - * - * - * - * + at TestContext.eval (eval at (/test/fixtures/test-runner/output/eval_dot.js:3:1), :6:11) + at diff --git a/test/fixtures/test-runner/output/eval_spec.snapshot b/test/fixtures/test-runner/output/eval_spec.snapshot index 116c23ccf97077..d5b4937bd12a34 100644 --- a/test/fixtures/test-runner/output/eval_spec.snapshot +++ b/test/fixtures/test-runner/output/eval_spec.snapshot @@ -13,10 +13,5 @@ ✖ fails (*ms) Error: fail - * - * - * - * - * - * - * + at TestContext.eval (eval at (/test/fixtures/test-runner/output/eval_spec.js:3:1), :6:11) + at diff --git a/test/fixtures/test-runner/output/eval_tap.snapshot b/test/fixtures/test-runner/output/eval_tap.snapshot index 50457b013633f4..85108ff8cc50b7 100644 --- a/test/fixtures/test-runner/output/eval_tap.snapshot +++ b/test/fixtures/test-runner/output/eval_tap.snapshot @@ -14,13 +14,8 @@ not ok 2 - fails error: 'fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext.eval (eval at (/test/fixtures/test-runner/output/eval_tap.js:3:1), :6:11) + ... 1..2 # tests 2 diff --git a/test/fixtures/test-runner/output/filtered-suite-throws.snapshot b/test/fixtures/test-runner/output/filtered-suite-throws.snapshot index cdcbbc8593df87..123b7f6e823940 100644 --- a/test/fixtures/test-runner/output/filtered-suite-throws.snapshot +++ b/test/fixtures/test-runner/output/filtered-suite-throws.snapshot @@ -4,21 +4,15 @@ not ok 1 - suite 1 --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):1' + location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:6:1' failureType: 'testCodeFailure' error: 'boom 1' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/filtered-suite-throws.js:7:9) + + Object. (/test/fixtures/test-runner/output/filtered-suite-throws.js:6:1) + ... # Subtest: suite 2 # Subtest: enabled - should get cancelled @@ -26,7 +20,7 @@ not ok 1 - suite 1 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):3' + location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:13:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -36,21 +30,15 @@ not ok 2 - suite 2 --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):1' + location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:12:1' failureType: 'testCodeFailure' error: 'boom 1' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/filtered-suite-throws.js:14:9) + + Object. (/test/fixtures/test-runner/output/filtered-suite-throws.js:12:1) + ... 1..2 # tests 1 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 1aaedf6df75fa3..52a8d63a2c2709 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 @@ -9,19 +9,13 @@ 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:(LINE):1' + 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' stack: |- - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/global_after_should_fail_the_test.js:5:9) + ... 1..1 # tests 1 diff --git a/test/fixtures/test-runner/output/hooks.snapshot b/test/fixtures/test-runner/output/hooks.snapshot index f9cfd9ddb1c206..4a576028d9b98d 100644 --- a/test/fixtures/test-runner/output/hooks.snapshot +++ b/test/fixtures/test-runner/output/hooks.snapshot @@ -50,7 +50,7 @@ ok 2 - describe hooks - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:74:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -60,7 +60,7 @@ ok 2 - describe hooks - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:75:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -70,38 +70,26 @@ not ok 3 - before throws --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:72:1' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/hooks.js:73:24) + ... # Subtest: before throws - no subtests not ok 4 - before throws - no subtests --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:78:1' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/hooks.js:79:24) + ... # Subtest: after throws # Subtest: 1 @@ -121,42 +109,26 @@ not ok 5 - after throws --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:83:1' failureType: 'hookFailed' error: 'after' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/hooks.js:84:23) + ... # Subtest: after throws - no subtests not ok 6 - after throws - no subtests --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:89:1' failureType: 'hookFailed' error: 'after' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/hooks.js:90:23) + ... # Subtest: beforeEach throws # Subtest: 1 @@ -164,20 +136,13 @@ not ok 6 - after throws - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:95:3' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:94:28) + new Promise () ... # Subtest: 2 @@ -185,20 +150,13 @@ not ok 6 - after throws - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:96:3' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:94:28) + async Promise.all (index 0) ... 1..2 @@ -206,7 +164,7 @@ not ok 7 - beforeEach throws --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:93:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -217,48 +175,35 @@ not ok 7 - beforeEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:101:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:100:27) + async Promise.all (index 0) - * + ... # Subtest: 2 not ok 2 - 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:102:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:100:27) + ... 1..2 not ok 8 - afterEach throws --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:99:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -269,20 +214,15 @@ not ok 8 - afterEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:107:3' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:107:25) + new Promise () - * - * + Array.map () ... # Subtest: 2 @@ -296,7 +236,7 @@ not ok 9 - afterEach when test fails --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:105:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -307,20 +247,15 @@ not ok 9 - afterEach when test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:113:3' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:113:25) + new Promise () - * - * + Array.map () ... # Subtest: 2 @@ -328,27 +263,20 @@ not ok 9 - afterEach when test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:114:3' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:112:27) + ... 1..2 not ok 10 - afterEach throws and test fails --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:111:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -403,84 +331,60 @@ ok 12 - test hooks - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:172:11' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + ... # Subtest: 2 not ok 2 - 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:173:11' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + ... 1..2 not ok 13 - t.before throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:169:1' failureType: 'testCodeFailure' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + ... # Subtest: t.before throws - no subtests not ok 14 - t.before throws - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:176:1' failureType: 'testCodeFailure' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:178:26) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:178:5) + ... # Subtest: t.after throws # Subtest: 1 @@ -500,40 +404,26 @@ not ok 15 - t.after throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:181:1' failureType: 'hookFailed' error: 'after' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:183:25) + ... # Subtest: t.after throws - no subtests not ok 16 - t.after throws - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:188:1' failureType: 'hookFailed' error: 'after' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:190:25) + ... # Subtest: t.beforeEach throws # Subtest: 1 @@ -541,49 +431,37 @@ not ok 16 - t.after throws - no subtests --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:197:11' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:196:30) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:197:11) + ... # Subtest: 2 not ok 2 - 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:198:11' failureType: 'hookFailed' error: 'beforeEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:196:30) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:198:11) + ... 1..2 not ok 17 - t.beforeEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:194:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -594,49 +472,37 @@ not ok 17 - t.beforeEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:204:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:203:29) + + async TestContext. (/test/fixtures/test-runner/output/hooks.js:204:3) + ... # Subtest: 2 not ok 2 - 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:205:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:203:29) + + async TestContext. (/test/fixtures/test-runner/output/hooks.js:205:3) + ... 1..2 not ok 18 - t.afterEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:201:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -647,20 +513,15 @@ not ok 18 - t.afterEach throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:212:11' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:212:35) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:212:11) + ... # Subtest: 2 ok 2 - 2 @@ -673,7 +534,7 @@ not ok 19 - afterEach when test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:209:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -697,22 +558,20 @@ ok 20 - afterEach context when test passes --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:232:11' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:226:15) + ... 1..1 not ok 21 - afterEach context when test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:225:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -723,48 +582,37 @@ not ok 21 - afterEach context when test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:238:11' failureType: 'testCodeFailure' error: 'test' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:238:35) + + TestContext. (/test/fixtures/test-runner/output/hooks.js:238:11) + ... # Subtest: 2 not ok 2 - 2 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11' + location: '/test/fixtures/test-runner/output/hooks.js:239:11' failureType: 'hookFailed' error: 'afterEach' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:237:29) + + async TestContext. (/test/fixtures/test-runner/output/hooks.js:239:3) + ... 1..2 not ok 22 - afterEach throws and test fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:235:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -774,15 +622,13 @@ not ok 23 - t.after() is called if test body throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:242:1' failureType: 'testCodeFailure' error: 'bye' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/hooks.js:246:9) + ... # - after() called # Subtest: run after when before throws @@ -791,7 +637,7 @@ not ok 23 - t.after() is called if test body throws --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):3' + location: '/test/fixtures/test-runner/output/hooks.js:254:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -801,19 +647,13 @@ not ok 24 - run after when before throws --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1' + location: '/test/fixtures/test-runner/output/hooks.js:249:1' failureType: 'hookFailed' error: 'before' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + SuiteContext. (/test/fixtures/test-runner/output/hooks.js:253:24) + ... # Subtest: test hooks - async # Subtest: 1 diff --git a/test/fixtures/test-runner/output/hooks_spec_reporter.js b/test/fixtures/test-runner/output/hooks_spec_reporter.js index 75bb4b6be1e908..81a125ab93289a 100644 --- a/test/fixtures/test-runner/output/hooks_spec_reporter.js +++ b/test/fixtures/test-runner/output/hooks_spec_reporter.js @@ -6,6 +6,6 @@ const spawn = require('node:child_process').spawn; const child = spawn(process.execPath, ['--no-warnings', '--test-reporter', 'spec', fixtures.path('test-runner/output/hooks.js')], { stdio: 'pipe' }); -// eslint-disable-next-line no-control-regex -child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, ''))); + +child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); diff --git a/test/fixtures/test-runner/output/hooks_spec_reporter.snapshot b/test/fixtures/test-runner/output/hooks_spec_reporter.snapshot index 8c267672b9a951..e2ad150bb5f7a2 100644 --- a/test/fixtures/test-runner/output/hooks_spec_reporter.snapshot +++ b/test/fixtures/test-runner/output/hooks_spec_reporter.snapshot @@ -1,466 +1,306 @@ - after() called - describe hooks - 1 (*ms) - 2 (*ms) - nested - nested 1 (*ms) - nested 2 (*ms) - nested (*ms) - describe hooks (*ms) - describe hooks - no subtests (*ms) - before throws - 1 - 2 - before throws (*ms) - before throws - no subtests (*ms) - after throws - 1 (*ms) - 2 (*ms) - after throws (*ms) - after throws - no subtests (*ms) - beforeEach throws - 1 (*ms) - 2 (*ms) - beforeEach throws (*ms) - afterEach throws - 1 (*ms) - 2 (*ms) - afterEach throws (*ms) - afterEach when test fails - 1 (*ms) - 2 (*ms) - afterEach when test fails (*ms) - afterEach throws and test fails - 1 (*ms) - 2 (*ms) - afterEach throws and test fails (*ms) - test hooks - 1 (*ms) - 2 (*ms) - nested - nested 1 (*ms) - nested 2 (*ms) - nested (*ms) - test hooks (*ms) - test hooks - no subtests (*ms) - t.before throws - 1 (*ms) - 2 (*ms) - t.before throws (*ms) - t.before throws - no subtests (*ms) - t.after throws - 1 (*ms) - 2 (*ms) - t.after throws (*ms) - t.after throws - no subtests (*ms) - t.beforeEach throws - 1 (*ms) - 2 (*ms) - t.beforeEach throws (*ms) - t.afterEach throws - 1 (*ms) - 2 (*ms) - t.afterEach throws (*ms) - afterEach when test fails - 1 (*ms) - 2 (*ms) - afterEach when test fails (*ms) - afterEach context when test passes - 1 (*ms) - afterEach context when test passes (*ms) - afterEach context when test fails - 1 (*ms) - afterEach context when test fails (*ms) - afterEach throws and test fails - 1 (*ms) - 2 (*ms) - afterEach throws and test fails (*ms) - t.after() is called if test body throws (*ms) - - after() called - run after when before throws - 1 - run after when before throws (*ms) - test hooks - async - 1 (*ms) - 2 (*ms) - test hooks - async (*ms) - before 1 called - before 2 called - after 1 called - after 2 called - tests 52 - suites 12 - pass 22 - fail 27 - cancelled 3 - skipped 0 - todo 0 - duration_ms * +▶ describe hooks + ✔ 1 (*ms) + ✔ 2 (*ms) + ▶ nested + ✔ nested 1 (*ms) + ✔ nested 2 (*ms) + ✔ nested (*ms) +✔ describe hooks (*ms) +✔ describe hooks - no subtests (*ms) +▶ before throws + ✖ 1 + ✖ 2 +✖ before throws (*ms) +✖ before throws - no subtests (*ms) +▶ after throws + ✔ 1 (*ms) + ✔ 2 (*ms) +✖ after throws (*ms) +✖ after throws - no subtests (*ms) +▶ beforeEach throws + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ beforeEach throws (*ms) +▶ afterEach throws + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ afterEach throws (*ms) +▶ afterEach when test fails + ✖ 1 (*ms) + ✔ 2 (*ms) +✖ afterEach when test fails (*ms) +▶ afterEach throws and test fails + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ afterEach throws and test fails (*ms) +▶ test hooks + ✔ 1 (*ms) + ✔ 2 (*ms) + ▶ nested + ✔ nested 1 (*ms) + ✔ nested 2 (*ms) + ✔ nested (*ms) +✔ test hooks (*ms) +✔ test hooks - no subtests (*ms) +▶ t.before throws + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ t.before throws (*ms) +✖ t.before throws - no subtests (*ms) +▶ t.after throws + ✔ 1 (*ms) + ✔ 2 (*ms) +✖ t.after throws (*ms) +✖ t.after throws - no subtests (*ms) +▶ t.beforeEach throws + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ t.beforeEach throws (*ms) +▶ t.afterEach throws + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ t.afterEach throws (*ms) +▶ afterEach when test fails + ✖ 1 (*ms) + ✔ 2 (*ms) +✖ afterEach when test fails (*ms) +▶ afterEach context when test passes + ✔ 1 (*ms) +✔ afterEach context when test passes (*ms) +▶ afterEach context when test fails + ✖ 1 (*ms) +✖ afterEach context when test fails (*ms) +▶ afterEach throws and test fails + ✖ 1 (*ms) + ✖ 2 (*ms) +✖ afterEach throws and test fails (*ms) +✖ t.after() is called if test body throws (*ms) +ℹ - after() called +▶ run after when before throws + ✖ 1 +✖ run after when before throws (*ms) +▶ test hooks - async + ✔ 1 (*ms) + ✔ 2 (*ms) +✔ test hooks - async (*ms) +ℹ before 1 called +ℹ before 2 called +ℹ after 1 called +ℹ after 2 called +ℹ tests 52 +ℹ suites 12 +ℹ pass 22 +ℹ fail 27 +ℹ cancelled 3 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms * - failing tests: +✖ failing tests: -* - 1 +test at test/fixtures/test-runner/output/hooks.js:74:3 +✖ 1 'test did not finish before its parent and was cancelled' -* - 2 +test at test/fixtures/test-runner/output/hooks.js:75:3 +✖ 2 'test did not finish before its parent and was cancelled' -* - before throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:72:1 +✖ before throws (*ms) Error: before - * - * - * - * - * - * - * - * + at SuiteContext. (/test/fixtures/test-runner/output/hooks.js:73:24) + at -* - before throws - no subtests (*ms) +test at test/fixtures/test-runner/output/hooks.js:78:1 +✖ before throws - no subtests (*ms) Error: before - * - * - * - * - * - * - * - * + at SuiteContext. (/test/fixtures/test-runner/output/hooks.js:79:24) + at -* - after throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:83:1 +✖ after throws (*ms) Error: after - * - * - * - * - * - * - * - * - * - * + at SuiteContext. (/test/fixtures/test-runner/output/hooks.js:84:23) + at -* - after throws - no subtests (*ms) +test at test/fixtures/test-runner/output/hooks.js:89:1 +✖ after throws - no subtests (*ms) Error: after - * - * - * - * - * - * - * - * - * - * + at SuiteContext. (/test/fixtures/test-runner/output/hooks.js:90:23) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:95:3 +✖ 1 (*ms) Error: beforeEach - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:94:28) + at at new Promise () -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:96:3 +✖ 2 (*ms) Error: beforeEach - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:94:28) + at at async Promise.all (index 0) -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:101:3 +✖ 1 (*ms) Error: afterEach - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:100:27) + at at async Promise.all (index 0) - * + at -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:102:3 +✖ 2 (*ms) Error: afterEach - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:100:27) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:107:3 +✖ 1 (*ms) Error: test - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:107:25) + at at new Promise () - * - * + at at Array.map () -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:113:3 +✖ 1 (*ms) Error: test - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:113:25) + at at new Promise () - * - * + at at Array.map () -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:114:3 +✖ 2 (*ms) Error: afterEach - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:112:27) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:172:11 +✖ 1 (*ms) Error: before - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + at -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:173:11 +✖ 2 (*ms) Error: before - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + at -* - t.before throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:169:1 +✖ t.before throws (*ms) Error: before - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:26) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:171:5) + at -* - t.before throws - no subtests (*ms) +test at test/fixtures/test-runner/output/hooks.js:176:1 +✖ t.before throws - no subtests (*ms) Error: before - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:178:26) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:178:5) + at -* - t.after throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:181:1 +✖ t.after throws (*ms) Error: after - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:183:25) + at -* - t.after throws - no subtests (*ms) +test at test/fixtures/test-runner/output/hooks.js:188:1 +✖ t.after throws - no subtests (*ms) Error: after - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:190:25) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:197:11 +✖ 1 (*ms) Error: beforeEach - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:196:30) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:197:11) + at -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:198:11 +✖ 2 (*ms) Error: beforeEach - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:196:30) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:198:11) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:204:11 +✖ 1 (*ms) Error: afterEach - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:203:29) + at + at async TestContext. (/test/fixtures/test-runner/output/hooks.js:204:3) + at -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:205:11 +✖ 2 (*ms) Error: afterEach - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:203:29) + at + at async TestContext. (/test/fixtures/test-runner/output/hooks.js:205:3) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:212:11 +✖ 1 (*ms) Error: test - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:212:35) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:212:11) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:232:11 +✖ 1 (*ms) Error: test - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:226:15) + at -* - 1 (*ms) +test at test/fixtures/test-runner/output/hooks.js:238:11 +✖ 1 (*ms) Error: test - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:238:35) + at + at TestContext. (/test/fixtures/test-runner/output/hooks.js:238:11) + at -* - 2 (*ms) +test at test/fixtures/test-runner/output/hooks.js:239:11 +✖ 2 (*ms) Error: afterEach - * - * - * - * - * - * - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:237:29) + at + at async TestContext. (/test/fixtures/test-runner/output/hooks.js:239:3) + at -* - t.after() is called if test body throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:242:1 +✖ t.after() is called if test body throws (*ms) Error: bye - * - * - * - * + at TestContext. (/test/fixtures/test-runner/output/hooks.js:246:9) + at -* - 1 +test at test/fixtures/test-runner/output/hooks.js:254:3 +✖ 1 'test did not finish before its parent and was cancelled' -* - run after when before throws (*ms) +test at test/fixtures/test-runner/output/hooks.js:249:1 +✖ run after when before throws (*ms) Error: before - * - * - * - * - * - * - * - * + at SuiteContext. (/test/fixtures/test-runner/output/hooks.js:253:24) + at diff --git a/test/fixtures/test-runner/output/junit_reporter.snapshot b/test/fixtures/test-runner/output/junit_reporter.snapshot index 5441bafe360ca2..1142b5b31ff2e7 100644 --- a/test/fixtures/test-runner/output/junit_reporter.snapshot +++ b/test/fixtures/test-runner/output/junit_reporter.snapshot @@ -23,13 +23,8 @@ code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from sync fail todo - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:42:9) + at } @@ -40,13 +35,8 @@ code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from sync fail todo with message - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:47:9) + at } @@ -64,13 +54,8 @@ code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from sync throw fail - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:63:9) + at } @@ -84,13 +69,8 @@ code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from async throw fail - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:75:9) + at } @@ -101,13 +81,8 @@ code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from async throw fail - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:80:9) + at } @@ -123,13 +98,9 @@ true !== false true !== false - * - * - * - * - * - * - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:85:10) + at + at { generatedMessage: true, code: 'ERR_ASSERTION', actual: true, @@ -147,13 +118,8 @@ true !== false code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: rejected from reject fail - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:93:25) + at } @@ -166,21 +132,15 @@ true !== false Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fail - * - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:125:11) + at { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from subtest sync throw fail - * - * - * - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:127:11) + at + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:125:11) + at } @@ -216,13 +176,8 @@ Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fail code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: this should be executed - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:212:9) + at } @@ -247,8 +202,8 @@ Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fail code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: callback failure - * - * + at Immediate.<anonymous> (/test/fixtures/test-runner/output/output.js:245:10) + at } @@ -266,21 +221,16 @@ Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fail code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from callback throw - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:267:9) + at } Error [ERR_TEST_FAILURE]: callback invoked multiple times - * - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:272:3) + at { code: 'ERR_TEST_FAILURE', failureType: 'multipleCallbackInvocations', cause: 'callback invoked multiple times' @@ -291,11 +241,11 @@ Error [ERR_TEST_FAILURE]: callback invoked multiple times Error [ERR_TEST_FAILURE]: callback invoked multiple times - * { + at { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: Error [ERR_TEST_FAILURE]: callback invoked multiple times - * { + at Immediate.<anonymous> (/test/fixtures/test-runner/output/output.js:283:5) { code: 'ERR_TEST_FAILURE', failureType: 'multipleCallbackInvocations', cause: 'callback invoked multiple times' @@ -306,12 +256,12 @@ Error [ERR_TEST_FAILURE]: callback invoked multiple times Error [ERR_TEST_FAILURE]: thrown from callback async throw - * { + at { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: Error: thrown from callback async throw - * - * + at Immediate.<anonymous> (/test/fixtures/test-runner/output/output.js:289:11) + at } @@ -342,39 +292,29 @@ Error [ERR_TEST_FAILURE]: thrown from callback async throw Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fails at first - * - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:334:11) + at { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from subtest sync throw fails at first - * - * - * - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:335:11) + at + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:334:11) + at } Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fails at second - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:337:11) { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: Error: thrown from subtest sync throw fails at second - * - * - * - * - * - * - * - * + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:338:11) + at + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:337:11) + at } @@ -400,26 +340,24 @@ Error [ERR_TEST_FAILURE]: thrown from subtest sync throw fails at second Error [ERR_TEST_FAILURE]: foo - * { + at { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: Error: foo - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + at } Error [ERR_TEST_FAILURE]: bar - * { + at { code: 'ERR_TEST_FAILURE', failureType: 'unhandledRejection', cause: Error: bar - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + at } @@ -497,7 +435,7 @@ should loosely deep-equal c: [Circular *1] } } - * { + at TestContext.<anonymous> (/test/fixtures/test-runner/output/output.js:425:12) { generatedMessage: true, code: 'ERR_ASSERTION', actual: [Object], @@ -511,7 +449,7 @@ should loosely deep-equal Error [ERR_TEST_FAILURE]: test could not be started because its parent finished - * { + at Immediate.<anonymous> (/test/fixtures/test-runner/output/output.js:197:7) { code: 'ERR_TEST_FAILURE', failureType: 'parentAlreadyFinished', cause: 'test could not be started because its parent finished' diff --git a/test/fixtures/test-runner/output/output.snapshot b/test/fixtures/test-runner/output/output.snapshot index b99744c9f12a2a..79ac90bd667dda 100644 --- a/test/fixtures/test-runner/output/output.snapshot +++ b/test/fixtures/test-runner/output/output.snapshot @@ -52,36 +52,26 @@ not ok 9 - sync fail todo # TODO --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:40:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:42:9) + ... # Subtest: sync fail todo with message not ok 10 - sync fail todo with message # TODO this is a failing todo --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:45:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo with message' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:47:9) + ... # Subtest: sync skip pass ok 11 - sync skip pass # SKIP @@ -107,18 +97,13 @@ not ok 14 - sync throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:62:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:63:9) + ... # Subtest: async skip pass ok 15 - async skip pass # SKIP @@ -137,43 +122,33 @@ not ok 17 - async throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:74:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:75:9) + ... # Subtest: async skip fail not ok 18 - async skip fail # SKIP --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:78:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:80:9) + ... # Subtest: async assertion fail not ok 19 - async assertion fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:83:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -186,13 +161,8 @@ not ok 19 - async assertion fail actual: true operator: 'strictEqual' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:85:10) + ... # Subtest: resolve pass ok 20 - resolve pass @@ -205,18 +175,13 @@ not ok 21 - reject fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:92:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:93:25) + ... # Subtest: unhandled rejection - passes but warns ok 22 - unhandled rejection - passes but warns @@ -254,21 +219,15 @@ ok 26 - immediate resolve pass --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:125:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:127:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:125:11) + ... # this subtest should make its parent test fail 1..1 @@ -276,7 +235,7 @@ not ok 27 - subtest sync throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:124:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -286,7 +245,7 @@ not ok 28 - sync throw non-error fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:131:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -371,18 +330,13 @@ not ok 34 - sync skip option is false fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:211:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:212:9) + ... # Subtest: ok 35 - @@ -443,13 +397,13 @@ not ok 44 - callback fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:243:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/output.js:245:10) + ... # Subtest: sync t is this in test ok 45 - sync t is this in test @@ -474,7 +428,7 @@ not ok 48 - callback also returns a Promise --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:262:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -484,31 +438,26 @@ not ok 49 - callback throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:266:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:267:9) + ... # Subtest: callback called twice not ok 50 - callback called twice --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:270:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:272:3) + ... # Subtest: callback called twice in different ticks ok 51 - callback called twice in different ticks @@ -521,25 +470,25 @@ not ok 52 - callback called twice in future tick --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:280:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/output.js:283:5) ... # Subtest: callback async throw not ok 53 - callback async throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:287:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/output.js:289:11) + ... # Subtest: callback async throw after done ok 54 - callback async throw after done @@ -577,7 +526,7 @@ not ok 56 - custom inspect symbol fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:311:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -587,7 +536,7 @@ not ok 57 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:322:1' failureType: 'testCodeFailure' error: |- { @@ -602,47 +551,37 @@ not ok 57 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:334:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:335:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:334:11) + ... # Subtest: sync throw fails at second not ok 2 - sync throw fails at second --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:337:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:338:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:337:11) + ... 1..2 not ok 58 - subtest sync throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:333:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -652,7 +591,7 @@ not ok 59 - timed out async test --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:342:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -662,7 +601,7 @@ not ok 60 - timed out callback test --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:351:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -690,7 +629,7 @@ not ok 64 - rejected thenable --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:380:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -700,35 +639,33 @@ not ok 65 - unfinished test with uncaughtException --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:391:1' failureType: 'uncaughtException' error: 'foo' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + ... # Subtest: unfinished test with unhandledRejection not ok 66 - unfinished test with unhandledRejection --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:397:1' failureType: 'unhandledRejection' error: 'bar' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + ... # Subtest: assertion errors display actual and expected properly not ok 67 - assertion errors display actual and expected properly --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:409:1' failureType: 'testCodeFailure' error: |- Expected values to be loosely deep-equal: @@ -791,28 +728,28 @@ not ok 67 - assertion errors display actual and expected properly string: 'Hello' operator: 'deepEqual' stack: |- - * + TestContext. (/test/fixtures/test-runner/output/output.js:425:12) ... # Subtest: invalid subtest fail not ok 68 - invalid subtest fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):7' + location: '/test/fixtures/test-runner/output/output.js:197:7' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/output.js:197:7) ... 1..68 -# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. # Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. -# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. # tests 81 # suites 0 # pass 40 diff --git a/test/fixtures/test-runner/output/output_cli.snapshot b/test/fixtures/test-runner/output/output_cli.snapshot index 25392dafaa0574..27a144d3e8043a 100644 --- a/test/fixtures/test-runner/output/output_cli.snapshot +++ b/test/fixtures/test-runner/output/output_cli.snapshot @@ -52,36 +52,26 @@ not ok 9 - sync fail todo # TODO --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:40:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:42:9) + ... # Subtest: sync fail todo with message not ok 10 - sync fail todo with message # TODO this is a failing todo --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:45:1' failureType: 'testCodeFailure' error: 'thrown from sync fail todo with message' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:47:9) + ... # Subtest: sync skip pass ok 11 - sync skip pass # SKIP @@ -107,18 +97,13 @@ not ok 14 - sync throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:62:1' failureType: 'testCodeFailure' error: 'thrown from sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:63:9) + ... # Subtest: async skip pass ok 15 - async skip pass # SKIP @@ -137,43 +122,33 @@ not ok 17 - async throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:74:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:75:9) + ... # Subtest: async skip fail not ok 18 - async skip fail # SKIP --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:78:1' failureType: 'testCodeFailure' error: 'thrown from async throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:80:9) + ... # Subtest: async assertion fail not ok 19 - async assertion fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:83:1' failureType: 'testCodeFailure' error: |- Expected values to be strictly equal: @@ -186,13 +161,8 @@ not ok 19 - async assertion fail actual: true operator: 'strictEqual' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:85:10) + ... # Subtest: resolve pass ok 20 - resolve pass @@ -205,18 +175,13 @@ not ok 21 - reject fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:92:1' failureType: 'testCodeFailure' error: 'rejected from reject fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:93:25) + ... # Subtest: unhandled rejection - passes but warns ok 22 - unhandled rejection - passes but warns @@ -254,21 +219,15 @@ ok 26 - immediate resolve pass --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:125:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fail' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:127:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:125:11) + ... # this subtest should make its parent test fail 1..1 @@ -276,7 +235,7 @@ not ok 27 - subtest sync throw fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:124:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -286,7 +245,7 @@ not ok 28 - sync throw non-error fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:131:1' failureType: 'testCodeFailure' error: 'Symbol(thrown symbol from sync throw non-error fail)' code: 'ERR_TEST_FAILURE' @@ -371,18 +330,13 @@ not ok 34 - sync skip option is false fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:211:1' failureType: 'testCodeFailure' error: 'this should be executed' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:212:9) + ... # Subtest: ok 35 - @@ -443,13 +397,13 @@ not ok 44 - callback fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:243:1' failureType: 'testCodeFailure' error: 'callback failure' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/output.js:245:10) + ... # Subtest: sync t is this in test ok 45 - sync t is this in test @@ -474,7 +428,7 @@ not ok 48 - callback also returns a Promise --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:262:1' failureType: 'callbackAndPromisePresent' error: 'passed a callback but also returned a Promise' code: 'ERR_TEST_FAILURE' @@ -484,31 +438,26 @@ not ok 49 - callback throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:266:1' failureType: 'testCodeFailure' error: 'thrown from callback throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:267:9) + ... # Subtest: callback called twice not ok 50 - callback called twice --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:270:1' failureType: 'multipleCallbackInvocations' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:272:3) + ... # Subtest: callback called twice in different ticks ok 51 - callback called twice in different ticks @@ -521,25 +470,25 @@ not ok 52 - callback called twice in future tick --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:280:1' failureType: 'uncaughtException' error: 'callback invoked multiple times' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/output.js:283:5) ... # Subtest: callback async throw not ok 53 - callback async throw --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:287:1' failureType: 'uncaughtException' error: 'thrown from callback async throw' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/output.js:289:11) + ... # Subtest: callback async throw after done ok 54 - callback async throw after done @@ -585,7 +534,7 @@ not ok 56 - custom inspect symbol fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:311:1' failureType: 'testCodeFailure' error: 'customized' code: 'ERR_TEST_FAILURE' @@ -595,7 +544,7 @@ not ok 57 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:322:1' failureType: 'testCodeFailure' error: |- { @@ -610,47 +559,37 @@ not ok 57 - custom inspect symbol that throws fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:334:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at first' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:335:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:334:11) + ... # Subtest: sync throw fails at second not ok 2 - sync throw fails at second --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):11' + location: '/test/fixtures/test-runner/output/output.js:337:11' failureType: 'testCodeFailure' error: 'thrown from subtest sync throw fails at second' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/output.js:338:11) + + TestContext. (/test/fixtures/test-runner/output/output.js:337:11) + ... 1..2 not ok 58 - subtest sync throw fails --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:333:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -660,7 +599,7 @@ not ok 59 - timed out async test --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:342:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -670,7 +609,7 @@ not ok 60 - timed out callback test --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:351:1' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -698,7 +637,7 @@ not ok 64 - rejected thenable --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:380:1' failureType: 'testCodeFailure' error: 'custom error' code: 'ERR_TEST_FAILURE' @@ -708,35 +647,33 @@ not ok 65 - unfinished test with uncaughtException --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:391:1' failureType: 'uncaughtException' error: 'foo' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + ... # Subtest: unfinished test with unhandledRejection not ok 66 - unfinished test with unhandledRejection --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:397:1' failureType: 'unhandledRejection' error: 'bar' code: 'ERR_TEST_FAILURE' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + ... # Subtest: assertion errors display actual and expected properly not ok 67 - assertion errors display actual and expected properly --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):1' + location: '/test/fixtures/test-runner/output/output.js:409:1' failureType: 'testCodeFailure' error: |- Expected values to be loosely deep-equal: @@ -799,27 +736,27 @@ not ok 67 - assertion errors display actual and expected properly string: 'Hello' operator: 'deepEqual' stack: |- - * + TestContext. (/test/fixtures/test-runner/output/output.js:425:12) ... # Subtest: invalid subtest fail not ok 68 - invalid subtest fail --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/output.js:(LINE):7' + location: '/test/fixtures/test-runner/output/output.js:197:7' failureType: 'parentAlreadyFinished' error: 'test could not be started because its parent finished' code: 'ERR_TEST_FAILURE' stack: |- - * + Immediate. (/test/fixtures/test-runner/output/output.js:197:7) ... -# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. # Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. -# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. -# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. +# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. # Subtest: last test ok 69 - last test --- diff --git a/test/fixtures/test-runner/output/source_mapped_locations.snapshot b/test/fixtures/test-runner/output/source_mapped_locations.snapshot index 41ddcd622c4e62..f5625b69fe5cee 100644 --- a/test/fixtures/test-runner/output/source_mapped_locations.snapshot +++ b/test/fixtures/test-runner/output/source_mapped_locations.snapshot @@ -17,11 +17,8 @@ not ok 1 - fails actual: 1 operator: 'strictEqual' stack: |- - * - * - * - * - * + TestContext. (/test/fixtures/test-runner/output/source_mapped_locations.ts:6:3) + ... 1..1 # tests 1 diff --git a/test/fixtures/test-runner/output/spec_reporter.js b/test/fixtures/test-runner/output/spec_reporter.js index 5edcb6e8d9c8df..131fa432f6d282 100644 --- a/test/fixtures/test-runner/output/spec_reporter.js +++ b/test/fixtures/test-runner/output/spec_reporter.js @@ -13,6 +13,5 @@ const child = spawn( { stdio: 'pipe' }, ); -// eslint-disable-next-line no-control-regex -child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, ''))); +child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); diff --git a/test/fixtures/test-runner/output/spec_reporter.snapshot b/test/fixtures/test-runner/output/spec_reporter.snapshot index 71a386e1756369..cbc5c3bac14b73 100644 --- a/test/fixtures/test-runner/output/spec_reporter.snapshot +++ b/test/fixtures/test-runner/output/spec_reporter.snapshot @@ -1,178 +1,149 @@ - sync expect fail (method) (*ms) # EXPECTED FAILURE - sync expect fail (options) (*ms) # EXPECTED FAILURE - async expect fail (method) (*ms) # EXPECTED FAILURE - async expect fail (options) (*ms) # EXPECTED FAILURE - sync todo with expect fail (*ms) # TODO - sync skip expect fail (*ms) # SKIP - sync pass todo (*ms) # TODO - sync pass todo with message (*ms) # this is a passing todo - sync fail todo (*ms) # TODO - sync fail todo with message (*ms) # this is a failing todo - sync skip pass (*ms) # SKIP - sync skip pass with message (*ms) # this is skipped - sync pass (*ms) - this test should pass - sync throw fail (*ms) - async skip pass (*ms) # SKIP - async pass (*ms) - async throw fail (*ms) - async skip fail (*ms) # SKIP - async assertion fail (*ms) - resolve pass (*ms) - reject fail (*ms) - unhandled rejection - passes but warns (*ms) - async unhandled rejection - passes but warns (*ms) - immediate throw - passes but warns (*ms) - immediate reject - passes but warns (*ms) - immediate resolve pass (*ms) - subtest sync throw fail - +sync throw fail (*ms) - this subtest should make its parent test fail - subtest sync throw fail (*ms) - sync throw non-error fail (*ms) - level 0a - level 1a (*ms) - level 1b (*ms) - level 1c (*ms) - level 1d (*ms) - level 0a (*ms) - top level - +long running (*ms) - +short running - ++short running (*ms) - +short running (*ms) - top level (*ms) - invalid subtest - pass but subtest fails (*ms) - sync skip option (*ms) # SKIP - sync skip option with message (*ms) # this is skipped - sync skip option is false fail (*ms) - (*ms) - functionOnly (*ms) - (*ms) - test with only a name provided (*ms) - (*ms) - (*ms) # SKIP - test with a name and options provided (*ms) # SKIP - functionAndOptions (*ms) # SKIP - callback pass (*ms) - callback fail (*ms) - sync t is this in test (*ms) - async t is this in test (*ms) - callback t is this in test (*ms) - callback also returns a Promise (*ms) - callback throw (*ms) - callback called twice (*ms) - callback called twice in different ticks (*ms) - callback called twice in future tick (*ms) - callback async throw (*ms) - callback async throw after done (*ms) - only is set on subtests but not in only mode - running subtest 1 (*ms) - running subtest 3 (*ms) - running subtest 4 (*ms) - only is set on subtests but not in only mode (*ms) - custom inspect symbol fail (*ms) - custom inspect symbol that throws fail (*ms) - subtest sync throw fails - sync throw fails at first (*ms) - sync throw fails at second (*ms) - subtest sync throw fails (*ms) - timed out async test (*ms) - timed out callback test (*ms) - large timeout async test is ok (*ms) - large timeout callback test is ok (*ms) - successful thenable (*ms) - rejected thenable (*ms) - unfinished test with uncaughtException (*ms) - unfinished test with unhandledRejection (*ms) - assertion errors display actual and expected properly (*ms) - invalid subtest fail (*ms) - Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. - Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. - Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. - Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. - tests 81 - suites 0 - pass 40 - fail 24 - cancelled 2 - skipped 10 - todo 5 - duration_ms * - - failing tests: - -* - sync fail todo (*ms) # TODO +✔ sync expect fail (method) (*ms) # EXPECTED FAILURE +✔ sync expect fail (options) (*ms) # EXPECTED FAILURE +✔ async expect fail (method) (*ms) # EXPECTED FAILURE +✔ async expect fail (options) (*ms) # EXPECTED FAILURE +✔ sync todo with expect fail (*ms) # TODO +﹣ sync skip expect fail (*ms) # SKIP +✔ sync pass todo (*ms) # TODO +✔ sync pass todo with message (*ms) # this is a passing todo +⚠ sync fail todo (*ms) # TODO +⚠ sync fail todo with message (*ms) # this is a failing todo +﹣ sync skip pass (*ms) # SKIP +﹣ sync skip pass with message (*ms) # this is skipped +✔ sync pass (*ms) +ℹ this test should pass +✖ sync throw fail (*ms) +﹣ async skip pass (*ms) # SKIP +✔ async pass (*ms) +✖ async throw fail (*ms) +﹣ async skip fail (*ms) # SKIP +✖ async assertion fail (*ms) +✔ resolve pass (*ms) +✖ reject fail (*ms) +✔ unhandled rejection - passes but warns (*ms) +✔ async unhandled rejection - passes but warns (*ms) +✔ immediate throw - passes but warns (*ms) +✔ immediate reject - passes but warns (*ms) +✔ immediate resolve pass (*ms) +▶ subtest sync throw fail + ✖ +sync throw fail (*ms) + ℹ this subtest should make its parent test fail +✖ subtest sync throw fail (*ms) +✖ sync throw non-error fail (*ms) +▶ level 0a + ✔ level 1a (*ms) + ✔ level 1b (*ms) + ✔ level 1c (*ms) + ✔ level 1d (*ms) +✔ level 0a (*ms) +▶ top level + ✔ +long running (*ms) + ▶ +short running + ✔ ++short running (*ms) + ✔ +short running (*ms) +✔ top level (*ms) +✔ invalid subtest - pass but subtest fails (*ms) +﹣ sync skip option (*ms) # SKIP +﹣ sync skip option with message (*ms) # this is skipped +✖ sync skip option is false fail (*ms) +✔ (*ms) +✔ functionOnly (*ms) +✔ (*ms) +✔ test with only a name provided (*ms) +✔ (*ms) +﹣ (*ms) # SKIP +﹣ test with a name and options provided (*ms) # SKIP +﹣ functionAndOptions (*ms) # SKIP +✔ callback pass (*ms) +✖ callback fail (*ms) +✔ sync t is this in test (*ms) +✔ async t is this in test (*ms) +✔ callback t is this in test (*ms) +✖ callback also returns a Promise (*ms) +✖ callback throw (*ms) +✖ callback called twice (*ms) +✔ callback called twice in different ticks (*ms) +✖ callback called twice in future tick (*ms) +✖ callback async throw (*ms) +✔ callback async throw after done (*ms) +▶ only is set on subtests but not in only mode + ✔ running subtest 1 (*ms) + ✔ running subtest 3 (*ms) + ✔ running subtest 4 (*ms) +✔ only is set on subtests but not in only mode (*ms) +✖ custom inspect symbol fail (*ms) +✖ custom inspect symbol that throws fail (*ms) +▶ subtest sync throw fails + ✖ sync throw fails at first (*ms) + ✖ sync throw fails at second (*ms) +✖ subtest sync throw fails (*ms) +✖ timed out async test (*ms) +✖ timed out callback test (*ms) +✔ large timeout async test is ok (*ms) +✔ large timeout callback test is ok (*ms) +✔ successful thenable (*ms) +✖ rejected thenable (*ms) +✖ unfinished test with uncaughtException (*ms) +✖ unfinished test with unhandledRejection (*ms) +✖ assertion errors display actual and expected properly (*ms) +✖ invalid subtest fail (*ms) +ℹ Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. +ℹ Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ tests 81 +ℹ suites 0 +ℹ pass 40 +ℹ fail 24 +ℹ cancelled 2 +ℹ skipped 10 +ℹ todo 5 +ℹ duration_ms * + +✖ failing tests: + +test at test/fixtures/test-runner/output/output.js:40:1 +⚠ sync fail todo (*ms) # TODO Error: thrown from sync fail todo - * - * - * - * - * - * - * - -* - sync fail todo with message (*ms) # this is a failing todo + at TestContext. (/test/fixtures/test-runner/output/output.js:42:9) + at + +test at test/fixtures/test-runner/output/output.js:45:1 +⚠ sync fail todo with message (*ms) # this is a failing todo Error: thrown from sync fail todo with message - * - * - * - * - * - * - * - -* - sync throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:47:9) + at + +test at test/fixtures/test-runner/output/output.js:62:1 +✖ sync throw fail (*ms) Error: thrown from sync throw fail - * - * - * - * - * - * - * - -* - async throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:63:9) + at + +test at test/fixtures/test-runner/output/output.js:74:1 +✖ async throw fail (*ms) Error: thrown from async throw fail - * - * - * - * - * - * - * - -* - async skip fail (*ms) # SKIP + at TestContext. (/test/fixtures/test-runner/output/output.js:75:9) + at + +test at test/fixtures/test-runner/output/output.js:78:1 +﹣ async skip fail (*ms) # SKIP Error: thrown from async throw fail - * - * - * - * - * - * - * - -* - async assertion fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:80:9) + at + +test at test/fixtures/test-runner/output/output.js:83:1 +✖ async assertion fail (*ms) AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: true !== false - * - * - * - * - * - * - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:85:10) + at + at { generatedMessage: true, code: 'ERR_ASSERTION', actual: true, @@ -181,148 +152,115 @@ diff: 'simple' } -* - reject fail (*ms) +test at test/fixtures/test-runner/output/output.js:92:1 +✖ reject fail (*ms) Error: rejected from reject fail - * - * - * - * - * - * - * - -* - +sync throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:93:25) + at + +test at test/fixtures/test-runner/output/output.js:125:11 +✖ +sync throw fail (*ms) Error: thrown from subtest sync throw fail - * - * - * - * - * - * - * - * - * - * - -* - sync throw non-error fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:127:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:125:11) + at + +test at test/fixtures/test-runner/output/output.js:131:1 +✖ sync throw non-error fail (*ms) Symbol(thrown symbol from sync throw non-error fail) -* - sync skip option is false fail (*ms) +test at test/fixtures/test-runner/output/output.js:211:1 +✖ sync skip option is false fail (*ms) Error: this should be executed - * - * - * - * - * - * - * - -* - callback fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:212:9) + at + +test at test/fixtures/test-runner/output/output.js:243:1 +✖ callback fail (*ms) Error: callback failure - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:245:10) + at -* - callback also returns a Promise (*ms) +test at test/fixtures/test-runner/output/output.js:262:1 +✖ callback also returns a Promise (*ms) 'passed a callback but also returned a Promise' -* - callback throw (*ms) +test at test/fixtures/test-runner/output/output.js:266:1 +✖ callback throw (*ms) Error: thrown from callback throw - * - * - * - * - * - * - * - -* - callback called twice (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:267:9) + at + +test at test/fixtures/test-runner/output/output.js:270:1 +✖ callback called twice (*ms) 'callback invoked multiple times' -* - callback called twice in future tick (*ms) +test at test/fixtures/test-runner/output/output.js:280:1 +✖ callback called twice in future tick (*ms) Error [ERR_TEST_FAILURE]: callback invoked multiple times - * { + at Immediate. (/test/fixtures/test-runner/output/output.js:283:5) { code: 'ERR_TEST_FAILURE', failureType: 'multipleCallbackInvocations', cause: 'callback invoked multiple times' } -* - callback async throw (*ms) +test at test/fixtures/test-runner/output/output.js:287:1 +✖ callback async throw (*ms) Error: thrown from callback async throw - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:289:11) + at -* - custom inspect symbol fail (*ms) +test at test/fixtures/test-runner/output/output.js:311:1 +✖ custom inspect symbol fail (*ms) customized -* - custom inspect symbol that throws fail (*ms) +test at test/fixtures/test-runner/output/output.js:322:1 +✖ custom inspect symbol that throws fail (*ms) { foo: 1, Symbol(nodejs.util.inspect.custom): [Function: [nodejs.util.inspect.custom]] } -* - sync throw fails at first (*ms) +test at test/fixtures/test-runner/output/output.js:334:11 +✖ sync throw fails at first (*ms) Error: thrown from subtest sync throw fails at first - * - * - * - * - * - * - * - * - * - * - -* - sync throw fails at second (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:335:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:334:11) + at + +test at test/fixtures/test-runner/output/output.js:337:11 +✖ sync throw fails at second (*ms) Error: thrown from subtest sync throw fails at second - * - * - * - * - * - * - * - * - -* - timed out async test (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:338:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:337:11) + at + +test at test/fixtures/test-runner/output/output.js:342:1 +✖ timed out async test (*ms) 'test timed out after *ms' -* - timed out callback test (*ms) +test at test/fixtures/test-runner/output/output.js:351:1 +✖ timed out callback test (*ms) 'test timed out after *ms' -* - rejected thenable (*ms) +test at test/fixtures/test-runner/output/output.js:380:1 +✖ rejected thenable (*ms) 'custom error' -* - unfinished test with uncaughtException (*ms) +test at test/fixtures/test-runner/output/output.js:391:1 +✖ unfinished test with uncaughtException (*ms) Error: foo - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + at -* - unfinished test with unhandledRejection (*ms) +test at test/fixtures/test-runner/output/output.js:397:1 +✖ unfinished test with unhandledRejection (*ms) Error: bar - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + at -* - assertion errors display actual and expected properly (*ms) +test at test/fixtures/test-runner/output/output.js:409:1 +✖ assertion errors display actual and expected properly (*ms) AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal: { @@ -358,7 +296,7 @@ c: [Circular *1] } } - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:425:12) { generatedMessage: true, code: 'ERR_ASSERTION', actual: [Object], @@ -367,6 +305,6 @@ diff: 'simple' } -* - invalid subtest fail (*ms) +test at test/fixtures/test-runner/output/output.js:197:7 +✖ invalid subtest fail (*ms) 'test could not be started because its parent finished' diff --git a/test/fixtures/test-runner/output/spec_reporter_cli.js b/test/fixtures/test-runner/output/spec_reporter_cli.js index 9802c6b3414a91..336ee71e7c8de8 100644 --- a/test/fixtures/test-runner/output/spec_reporter_cli.js +++ b/test/fixtures/test-runner/output/spec_reporter_cli.js @@ -14,6 +14,5 @@ const child = spawn( { stdio: 'pipe' }, ); -// eslint-disable-next-line no-control-regex -child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, ''))); +child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); diff --git a/test/fixtures/test-runner/output/spec_reporter_cli.snapshot b/test/fixtures/test-runner/output/spec_reporter_cli.snapshot index 5d082244aa3447..fff7f9b0f123fe 100644 --- a/test/fixtures/test-runner/output/spec_reporter_cli.snapshot +++ b/test/fixtures/test-runner/output/spec_reporter_cli.snapshot @@ -1,181 +1,152 @@ - sync expect fail (method) (*ms) # EXPECTED FAILURE - sync expect fail (options) (*ms) # EXPECTED FAILURE - async expect fail (method) (*ms) # EXPECTED FAILURE - async expect fail (options) (*ms) # EXPECTED FAILURE - sync todo with expect fail (*ms) # TODO - sync skip expect fail (*ms) # SKIP - sync pass todo (*ms) # TODO - sync pass todo with message (*ms) # this is a passing todo - sync fail todo (*ms) # TODO - sync fail todo with message (*ms) # this is a failing todo - sync skip pass (*ms) # SKIP - sync skip pass with message (*ms) # this is skipped - sync pass (*ms) - this test should pass - sync throw fail (*ms) - async skip pass (*ms) # SKIP - async pass (*ms) - async throw fail (*ms) - async skip fail (*ms) # SKIP - async assertion fail (*ms) - resolve pass (*ms) - reject fail (*ms) - unhandled rejection - passes but warns (*ms) - async unhandled rejection - passes but warns (*ms) - immediate throw - passes but warns (*ms) - immediate reject - passes but warns (*ms) - immediate resolve pass (*ms) - subtest sync throw fail - +sync throw fail (*ms) - this subtest should make its parent test fail - subtest sync throw fail (*ms) - sync throw non-error fail (*ms) - level 0a - level 1a (*ms) - level 1b (*ms) - level 1c (*ms) - level 1d (*ms) - level 0a (*ms) - top level - +long running (*ms) - +short running - ++short running (*ms) - +short running (*ms) - top level (*ms) - invalid subtest - pass but subtest fails (*ms) - sync skip option (*ms) # SKIP - sync skip option with message (*ms) # this is skipped - sync skip option is false fail (*ms) - (*ms) - functionOnly (*ms) - (*ms) - test with only a name provided (*ms) - (*ms) - (*ms) # SKIP - test with a name and options provided (*ms) # SKIP - functionAndOptions (*ms) # SKIP - callback pass (*ms) - callback fail (*ms) - sync t is this in test (*ms) - async t is this in test (*ms) - callback t is this in test (*ms) - callback also returns a Promise (*ms) - callback throw (*ms) - callback called twice (*ms) - callback called twice in different ticks (*ms) - callback called twice in future tick (*ms) - callback async throw (*ms) - callback async throw after done (*ms) - only is set on subtests but not in only mode - running subtest 1 (*ms) - running subtest 2 (*ms) - 'only' and 'runOnly' require the --test-only command-line option. - running subtest 3 (*ms) - 'only' and 'runOnly' require the --test-only command-line option. - running subtest 4 (*ms) - only is set on subtests but not in only mode (*ms) - custom inspect symbol fail (*ms) - custom inspect symbol that throws fail (*ms) - subtest sync throw fails - sync throw fails at first (*ms) - sync throw fails at second (*ms) - subtest sync throw fails (*ms) - timed out async test (*ms) - timed out callback test (*ms) - large timeout async test is ok (*ms) - large timeout callback test is ok (*ms) - successful thenable (*ms) - rejected thenable (*ms) - unfinished test with uncaughtException (*ms) - unfinished test with unhandledRejection (*ms) - assertion errors display actual and expected properly (*ms) - invalid subtest fail (*ms) - Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. - Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. - Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. - Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. - Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. - tests 82 - suites 0 - pass 41 - fail 24 - cancelled 2 - skipped 10 - todo 5 - duration_ms * - - failing tests: - -* - sync fail todo (*ms) # TODO +✔ sync expect fail (method) (*ms) # EXPECTED FAILURE +✔ sync expect fail (options) (*ms) # EXPECTED FAILURE +✔ async expect fail (method) (*ms) # EXPECTED FAILURE +✔ async expect fail (options) (*ms) # EXPECTED FAILURE +✔ sync todo with expect fail (*ms) # TODO +﹣ sync skip expect fail (*ms) # SKIP +✔ sync pass todo (*ms) # TODO +✔ sync pass todo with message (*ms) # this is a passing todo +⚠ sync fail todo (*ms) # TODO +⚠ sync fail todo with message (*ms) # this is a failing todo +﹣ sync skip pass (*ms) # SKIP +﹣ sync skip pass with message (*ms) # this is skipped +✔ sync pass (*ms) +ℹ this test should pass +✖ sync throw fail (*ms) +﹣ async skip pass (*ms) # SKIP +✔ async pass (*ms) +✖ async throw fail (*ms) +﹣ async skip fail (*ms) # SKIP +✖ async assertion fail (*ms) +✔ resolve pass (*ms) +✖ reject fail (*ms) +✔ unhandled rejection - passes but warns (*ms) +✔ async unhandled rejection - passes but warns (*ms) +✔ immediate throw - passes but warns (*ms) +✔ immediate reject - passes but warns (*ms) +✔ immediate resolve pass (*ms) +▶ subtest sync throw fail + ✖ +sync throw fail (*ms) + ℹ this subtest should make its parent test fail +✖ subtest sync throw fail (*ms) +✖ sync throw non-error fail (*ms) +▶ level 0a + ✔ level 1a (*ms) + ✔ level 1b (*ms) + ✔ level 1c (*ms) + ✔ level 1d (*ms) +✔ level 0a (*ms) +▶ top level + ✔ +long running (*ms) + ▶ +short running + ✔ ++short running (*ms) + ✔ +short running (*ms) +✔ top level (*ms) +✔ invalid subtest - pass but subtest fails (*ms) +﹣ sync skip option (*ms) # SKIP +﹣ sync skip option with message (*ms) # this is skipped +✖ sync skip option is false fail (*ms) +✔ (*ms) +✔ functionOnly (*ms) +✔ (*ms) +✔ test with only a name provided (*ms) +✔ (*ms) +﹣ (*ms) # SKIP +﹣ test with a name and options provided (*ms) # SKIP +﹣ functionAndOptions (*ms) # SKIP +✔ callback pass (*ms) +✖ callback fail (*ms) +✔ sync t is this in test (*ms) +✔ async t is this in test (*ms) +✔ callback t is this in test (*ms) +✖ callback also returns a Promise (*ms) +✖ callback throw (*ms) +✖ callback called twice (*ms) +✔ callback called twice in different ticks (*ms) +✖ callback called twice in future tick (*ms) +✖ callback async throw (*ms) +✔ callback async throw after done (*ms) +▶ only is set on subtests but not in only mode + ✔ running subtest 1 (*ms) + ✔ running subtest 2 (*ms) + ℹ 'only' and 'runOnly' require the --test-only command-line option. + ✔ running subtest 3 (*ms) + ℹ 'only' and 'runOnly' require the --test-only command-line option. + ✔ running subtest 4 (*ms) +✔ only is set on subtests but not in only mode (*ms) +✖ custom inspect symbol fail (*ms) +✖ custom inspect symbol that throws fail (*ms) +▶ subtest sync throw fails + ✖ sync throw fails at first (*ms) + ✖ sync throw fails at second (*ms) +✖ subtest sync throw fails (*ms) +✖ timed out async test (*ms) +✖ timed out callback test (*ms) +✔ large timeout async test is ok (*ms) +✔ large timeout callback test is ok (*ms) +✔ successful thenable (*ms) +✖ rejected thenable (*ms) +✖ unfinished test with uncaughtException (*ms) +✖ unfinished test with unhandledRejection (*ms) +✖ assertion errors display actual and expected properly (*ms) +✖ invalid subtest fail (*ms) +ℹ Error: Test "unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:96:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: Test "async unhandled rejection - passes but warns" at test/fixtures/test-runner/output/output.js:100:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: A resource generated asynchronous activity after the test ended. This activity created the error "Error: uncaught from outside of a test" which triggered an uncaughtException event, caught by the test runner. +ℹ Error: Test "immediate throw - passes but warns" at test/fixtures/test-runner/output/output.js:104:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:110:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. +ℹ Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:275:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:293:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. +ℹ tests 82 +ℹ suites 0 +ℹ pass 41 +ℹ fail 24 +ℹ cancelled 2 +ℹ skipped 10 +ℹ todo 5 +ℹ duration_ms * + +✖ failing tests: + +test at test/fixtures/test-runner/output/output.js:40:1 +⚠ sync fail todo (*ms) # TODO Error: thrown from sync fail todo - * - * - * - * - * - * - * - -* - sync fail todo with message (*ms) # this is a failing todo + at TestContext. (/test/fixtures/test-runner/output/output.js:42:9) + at + +test at test/fixtures/test-runner/output/output.js:45:1 +⚠ sync fail todo with message (*ms) # this is a failing todo Error: thrown from sync fail todo with message - * - * - * - * - * - * - * - -* - sync throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:47:9) + at + +test at test/fixtures/test-runner/output/output.js:62:1 +✖ sync throw fail (*ms) Error: thrown from sync throw fail - * - * - * - * - * - * - * - -* - async throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:63:9) + at + +test at test/fixtures/test-runner/output/output.js:74:1 +✖ async throw fail (*ms) Error: thrown from async throw fail - * - * - * - * - * - * - * - -* - async skip fail (*ms) # SKIP + at TestContext. (/test/fixtures/test-runner/output/output.js:75:9) + at + +test at test/fixtures/test-runner/output/output.js:78:1 +﹣ async skip fail (*ms) # SKIP Error: thrown from async throw fail - * - * - * - * - * - * - * - -* - async assertion fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:80:9) + at + +test at test/fixtures/test-runner/output/output.js:83:1 +✖ async assertion fail (*ms) AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: true !== false - * - * - * - * - * - * - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:85:10) + at + at { generatedMessage: true, code: 'ERR_ASSERTION', actual: true, @@ -184,148 +155,115 @@ diff: 'simple' } -* - reject fail (*ms) +test at test/fixtures/test-runner/output/output.js:92:1 +✖ reject fail (*ms) Error: rejected from reject fail - * - * - * - * - * - * - * - -* - +sync throw fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:93:25) + at + +test at test/fixtures/test-runner/output/output.js:125:11 +✖ +sync throw fail (*ms) Error: thrown from subtest sync throw fail - * - * - * - * - * - * - * - * - * - * - -* - sync throw non-error fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:127:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:125:11) + at + +test at test/fixtures/test-runner/output/output.js:131:1 +✖ sync throw non-error fail (*ms) Symbol(thrown symbol from sync throw non-error fail) -* - sync skip option is false fail (*ms) +test at test/fixtures/test-runner/output/output.js:211:1 +✖ sync skip option is false fail (*ms) Error: this should be executed - * - * - * - * - * - * - * - -* - callback fail (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:212:9) + at + +test at test/fixtures/test-runner/output/output.js:243:1 +✖ callback fail (*ms) Error: callback failure - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:245:10) + at -* - callback also returns a Promise (*ms) +test at test/fixtures/test-runner/output/output.js:262:1 +✖ callback also returns a Promise (*ms) 'passed a callback but also returned a Promise' -* - callback throw (*ms) +test at test/fixtures/test-runner/output/output.js:266:1 +✖ callback throw (*ms) Error: thrown from callback throw - * - * - * - * - * - * - * - -* - callback called twice (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:267:9) + at + +test at test/fixtures/test-runner/output/output.js:270:1 +✖ callback called twice (*ms) 'callback invoked multiple times' -* - callback called twice in future tick (*ms) +test at test/fixtures/test-runner/output/output.js:280:1 +✖ callback called twice in future tick (*ms) Error [ERR_TEST_FAILURE]: callback invoked multiple times - * { + at Immediate. (/test/fixtures/test-runner/output/output.js:283:5) { code: 'ERR_TEST_FAILURE', failureType: 'multipleCallbackInvocations', cause: 'callback invoked multiple times' } -* - callback async throw (*ms) +test at test/fixtures/test-runner/output/output.js:287:1 +✖ callback async throw (*ms) Error: thrown from callback async throw - * - * + at Immediate. (/test/fixtures/test-runner/output/output.js:289:11) + at -* - custom inspect symbol fail (*ms) +test at test/fixtures/test-runner/output/output.js:311:1 +✖ custom inspect symbol fail (*ms) customized -* - custom inspect symbol that throws fail (*ms) +test at test/fixtures/test-runner/output/output.js:322:1 +✖ custom inspect symbol that throws fail (*ms) { foo: 1 } -* - sync throw fails at first (*ms) +test at test/fixtures/test-runner/output/output.js:334:11 +✖ sync throw fails at first (*ms) Error: thrown from subtest sync throw fails at first - * - * - * - * - * - * - * - * - * - * - -* - sync throw fails at second (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:335:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:334:11) + at + +test at test/fixtures/test-runner/output/output.js:337:11 +✖ sync throw fails at second (*ms) Error: thrown from subtest sync throw fails at second - * - * - * - * - * - * - * - * - -* - timed out async test (*ms) + at TestContext. (/test/fixtures/test-runner/output/output.js:338:11) + at + at TestContext. (/test/fixtures/test-runner/output/output.js:337:11) + at + +test at test/fixtures/test-runner/output/output.js:342:1 +✖ timed out async test (*ms) 'test timed out after *ms' -* - timed out callback test (*ms) +test at test/fixtures/test-runner/output/output.js:351:1 +✖ timed out callback test (*ms) 'test timed out after *ms' -* - rejected thenable (*ms) +test at test/fixtures/test-runner/output/output.js:380:1 +✖ rejected thenable (*ms) 'custom error' -* - unfinished test with uncaughtException (*ms) +test at test/fixtures/test-runner/output/output.js:391:1 +✖ unfinished test with uncaughtException (*ms) Error: foo - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:393:30) + at -* - unfinished test with unhandledRejection (*ms) +test at test/fixtures/test-runner/output/output.js:397:1 +✖ unfinished test with unhandledRejection (*ms) Error: bar - * - * - * + at Timeout._onTimeout (/test/fixtures/test-runner/output/output.js:399:37) + at -* - assertion errors display actual and expected properly (*ms) +test at test/fixtures/test-runner/output/output.js:409:1 +✖ assertion errors display actual and expected properly (*ms) AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal: { @@ -361,7 +299,7 @@ c: [Circular *1] } } - * { + at TestContext. (/test/fixtures/test-runner/output/output.js:425:12) { generatedMessage: true, code: 'ERR_ASSERTION', actual: { foo: 1, bar: 1, boo: [ 1 ], baz: { date: 1970-01-01T00:00:00.000Z, null: null, number: 1, string: 'Hello', undefined: undefined } }, @@ -370,6 +308,6 @@ diff: 'simple' } -* - invalid subtest fail (*ms) +test at test/fixtures/test-runner/output/output.js:197:7 +✖ invalid subtest fail (*ms) 'test could not be started because its parent finished' diff --git a/test/fixtures/test-runner/output/test-runner-plan-timeout.snapshot b/test/fixtures/test-runner/output/test-runner-plan-timeout.snapshot index b704f0af39cf74..8982635f1f8208 100644 --- a/test/fixtures/test-runner/output/test-runner-plan-timeout.snapshot +++ b/test/fixtures/test-runner/output/test-runner-plan-timeout.snapshot @@ -11,7 +11,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:17:3' failureType: 'uncaughtException' error: |- The expression evaluated to a falsy value: @@ -24,16 +24,15 @@ TAP version 13 actual: false operator: '==' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/test-runner-plan-timeout.js:22:18) + ... # Subtest: planning wait time expires before plan is met not ok 3 - planning wait time expires before plan is met --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:29:3' failureType: 'testTimeoutFailure' error: 'plan timed out after 500ms with 0 assertions when expecting 2' code: 'ERR_TEST_FAILURE' @@ -49,7 +48,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:53:3' failureType: 'uncaughtException' error: |- The expression evaluated to a falsy value: @@ -62,16 +61,15 @@ TAP version 13 actual: false operator: '==' stack: |- - * - * - * + Timeout._onTimeout (/test/fixtures/test-runner/output/test-runner-plan-timeout.js:58:18) + ... # Subtest: planning with wait "options.wait : false" should not wait not ok 6 - planning with wait "options.wait : false" should not wait --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:65:3' failureType: 'testCodeFailure' error: 'plan expected 1 assertions but received 0' code: 'ERR_TEST_FAILURE' @@ -81,7 +79,7 @@ not ok 1 - planning with wait --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-runner-plan-timeout.js:4:1' failureType: 'subtestsFailed' error: '4 subtests failed' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/test-runner-plan.snapshot b/test/fixtures/test-runner/output/test-runner-plan.snapshot index 8698312a519d81..7cfc1977901216 100644 --- a/test/fixtures/test-runner/output/test-runner-plan.snapshot +++ b/test/fixtures/test-runner/output/test-runner-plan.snapshot @@ -35,7 +35,7 @@ not ok 3 - less assertions than planned --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-runner-plan.js:40:1' failureType: 'testCodeFailure' error: 'plan expected 1 assertions but received 0' code: 'ERR_TEST_FAILURE' @@ -45,7 +45,7 @@ not ok 4 - more assertions than planned --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-runner-plan.js:44:1' failureType: 'testCodeFailure' error: 'plan expected 1 assertions but received 2' code: 'ERR_TEST_FAILURE' @@ -94,7 +94,7 @@ not ok 8 - failing planning by options --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-runner-plan.js:72:1' failureType: 'testCodeFailure' error: 'plan expected 1 assertions but received 0' code: 'ERR_TEST_FAILURE' @@ -123,7 +123,7 @@ not ok 11 - failing more assertions than planned --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-runner-plan.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-runner-plan.js:85:1' failureType: 'testCodeFailure' error: 'plan expected 2 assertions but received 3' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/test-runner-watch-spec.snapshot b/test/fixtures/test-runner/output/test-runner-watch-spec.snapshot index c0af6b179c20b7..2bf56936159e35 100644 --- a/test/fixtures/test-runner/output/test-runner-watch-spec.snapshot +++ b/test/fixtures/test-runner/output/test-runner-watch-spec.snapshot @@ -11,15 +11,11 @@ ✖ failing tests: -* +test at test//failing-test.js:3:3 ✖ failing test (*ms) Error: failed - * - * - * - * - * - * + at TestContext. (/test//failing-test.js:4:11) + at ℹ tests 0 ℹ suites 0 ℹ pass 0 diff --git a/test/fixtures/test-runner/output/test-timeout-flag.snapshot b/test/fixtures/test-runner/output/test-timeout-flag.snapshot index 2c45befde37c5f..2b5ba9d76a2031 100644 --- a/test/fixtures/test-runner/output/test-timeout-flag.snapshot +++ b/test/fixtures/test-runner/output/test-timeout-flag.snapshot @@ -5,7 +5,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-timeout-flag.js:8:3' failureType: 'testTimeoutFailure' error: 'test timed out after 100ms' code: 'ERR_TEST_FAILURE' @@ -17,7 +17,7 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-timeout-flag.js:16:3' failureType: 'testTimeoutFailure' error: 'test timed out after 5ms' code: 'ERR_TEST_FAILURE' @@ -39,7 +39,7 @@ not ok 1 - --test-timeout is set to 100ms --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-timeout-flag.js:5:1' failureType: 'subtestsFailed' error: '2 subtests failed' code: 'ERR_TEST_FAILURE' @@ -50,7 +50,7 @@ not ok 1 - --test-timeout is set to 100ms --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):3' + location: '/test/fixtures/test-runner/output/test-timeout-flag.js:51:3' failureType: 'cancelledByParent' error: 'test did not finish before its parent and was cancelled' code: 'ERR_TEST_FAILURE' @@ -60,7 +60,7 @@ not ok 2 - should inherit timeout options to children --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/test-timeout-flag.js:(LINE):1' + location: '/test/fixtures/test-runner/output/test-timeout-flag.js:42:1' failureType: 'testTimeoutFailure' error: 'test timed out after 1ms' 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 a22daa3174ce0f..00d34906582371 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 @@ -10,7 +10,7 @@ gonna timeout --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:(LINE):3' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:18:3' failureType: 'hookFailed' error: 'failed running beforeEach hook' code: 'ERR_TEST_FAILURE' @@ -28,7 +28,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:(LINE):1' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:6:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' @@ -41,7 +41,7 @@ not gonna timeout --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:(LINE):3' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:40:3' failureType: 'hookFailed' error: 'failed running afterEach hook' code: 'ERR_TEST_FAILURE' @@ -59,7 +59,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:(LINE):1' + location: '/test/fixtures/test-runner/output/timeout_in_before_each_should_not_affect_further_tests.js:28:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/test-runner/output/unfinished-suite-async-error.snapshot b/test/fixtures/test-runner/output/unfinished-suite-async-error.snapshot index 59c04c818c7458..ae9765ee054259 100644 --- a/test/fixtures/test-runner/output/unfinished-suite-async-error.snapshot +++ b/test/fixtures/test-runner/output/unfinished-suite-async-error.snapshot @@ -5,13 +5,13 @@ TAP version 13 --- duration_ms: * type: 'test' - location: '/test/fixtures/test-runner/output/unfinished-suite-async-error.js:(LINE):3' + location: '/test/fixtures/test-runner/output/unfinished-suite-async-error.js:5:3' failureType: 'uncaughtException' error: 'callback test does not complete' code: 'ERR_TEST_FAILURE' stack: |- - * - * + Immediate. (/test/fixtures/test-runner/output/unfinished-suite-async-error.js:7:13) + ... # Subtest: should pass 1 ok 2 - should pass 1 @@ -24,7 +24,7 @@ not ok 1 - unfinished suite with asynchronous error --- duration_ms: * type: 'suite' - location: '/test/fixtures/test-runner/output/unfinished-suite-async-error.js:(LINE):1' + location: '/test/fixtures/test-runner/output/unfinished-suite-async-error.js:4:1' failureType: 'subtestsFailed' error: '1 subtest failed' code: 'ERR_TEST_FAILURE' diff --git a/test/fixtures/v8/v8_warning.snapshot b/test/fixtures/v8/v8_warning.snapshot index 5419601c1d27d3..87c7c86b4fedeb 100644 --- a/test/fixtures/v8/v8_warning.snapshot +++ b/test/fixtures/v8/v8_warning.snapshot @@ -1,2 +1,2 @@ -(node:) V8: /test/fixtures/v8/v8_warning.js:* Invalid asm.js: Invalid return type +(node:) V8: /test/fixtures/v8/v8_warning.js:13 Invalid asm.js: Invalid return type (Use ` --trace-warnings ...` to show where the warning was created) diff --git a/test/fixtures/vm/vm_display_runtime_error.snapshot b/test/fixtures/vm/vm_display_runtime_error.snapshot index a20375f224c625..87fa3d7b6a6458 100644 --- a/test/fixtures/vm/vm_display_runtime_error.snapshot +++ b/test/fixtures/vm/vm_display_runtime_error.snapshot @@ -5,8 +5,7 @@ throw new Error("boo!") Error: boo! at test.vm:1:7 - at Script.runInThisContext (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_display_runtime_error.js:31:6) test.vm:1 throw new Error("spooky!") @@ -14,8 +13,7 @@ throw new Error("spooky!") Error: spooky! at test.vm:1:7 - at Script.runInThisContext (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_display_runtime_error.js:36:4) Node.js diff --git a/test/fixtures/vm/vm_display_syntax_error.snapshot b/test/fixtures/vm/vm_display_syntax_error.snapshot index b374091a1e67b3..87e9872563876f 100644 --- a/test/fixtures/vm/vm_display_syntax_error.snapshot +++ b/test/fixtures/vm/vm_display_syntax_error.snapshot @@ -4,18 +4,14 @@ var 4; ^ SyntaxError: Unexpected number - at new Script (node:vm:*) - at createScript (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_display_syntax_error.js:31:6) test.vm:1 var 5; ^ SyntaxError: Unexpected number - at new Script (node:vm:*) - at createScript (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_display_syntax_error.js:36:4) Node.js diff --git a/test/fixtures/vm/vm_dont_display_runtime_error.snapshot b/test/fixtures/vm/vm_dont_display_runtime_error.snapshot index fd64cf80c91004..c111ca1d90bff9 100644 --- a/test/fixtures/vm/vm_dont_display_runtime_error.snapshot +++ b/test/fixtures/vm/vm_dont_display_runtime_error.snapshot @@ -6,8 +6,7 @@ throw new Error("boo!") Error: boo! at test.vm:1:7 - at Script.runInThisContext (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_dont_display_runtime_error.js:41:4) Node.js diff --git a/test/fixtures/vm/vm_dont_display_syntax_error.snapshot b/test/fixtures/vm/vm_dont_display_syntax_error.snapshot index 26790583539470..58e24ca762422e 100644 --- a/test/fixtures/vm/vm_dont_display_syntax_error.snapshot +++ b/test/fixtures/vm/vm_dont_display_syntax_error.snapshot @@ -5,9 +5,7 @@ var 5; ^ SyntaxError: Unexpected number - at new Script (node:vm:*) - at createScript (node:vm:*) - at Object.runInThisContext (node:vm:*) + at at Object. (/test/fixtures/vm/vm_dont_display_syntax_error.js:41:4) Node.js diff --git a/test/parallel/test-node-output-console.mjs b/test/parallel/test-node-output-console.mjs index 8fabed9db60ab7..e9b001db336cf5 100644 --- a/test/parallel/test-node-output-console.mjs +++ b/test/parallel/test-node-output-console.mjs @@ -7,37 +7,20 @@ const skipForceColors = process.config.variables.icu_gyp_path !== 'tools/icu/icu-generic.gyp' || process.config.variables.node_shared_openssl; -function replaceStackTrace(str) { - return snapshot.replaceStackTrace(str, '$1at *$7\n'); -} - describe('console output', { concurrency: !process.env.TEST_PARALLEL }, () => { - function normalize(str) { - return str.replaceAll(/\d+/g, '*'); - } const tests = [ { name: 'console/2100bytes.js' }, { name: 'console/console_low_stack_space.js' }, { name: 'console/console.js' }, { name: 'console/hello_world.js' }, - { - name: 'console/stack_overflow.js', - transform: snapshot - .transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - normalize - ) - }, + { name: 'console/stack_overflow.js' }, !skipForceColors ? { name: 'console/force_colors.js', env: { FORCE_COLOR: 1 } } : null, ].filter(Boolean); - const defaultTransform = snapshot - .transform(snapshot.basicTransform, replaceStackTrace); - for (const { name, transform, env } of tests) { + for (const { name, env } of tests) { it(name, async () => { await snapshot.spawnAndAssert( fixtures.path(name), - transform ?? defaultTransform, + snapshot.defaultTransform, { env: { ...env, ...process.env } }, ); }); diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs index 731a21243481f4..3764ce52107379 100644 --- a/test/parallel/test-node-output-errors.mjs +++ b/test/parallel/test-node-output-errors.mjs @@ -7,41 +7,7 @@ import { describe, it } from 'node:test'; const skipForceColors = (common.isWindows && (Number(os.release().split('.')[0]) !== 10 || Number(os.release().split('.')[2]) < 14393)); // See https://github.com/nodejs/node/pull/33132 - -function replaceStackTrace(str) { - return snapshot.replaceStackTrace(str, '$1at *$7\n'); -} - -function replaceForceColorsStackTrace(str) { - // eslint-disable-next-line no-control-regex - return str.replaceAll(/(\[90m\W+)at .*node:.*/g, '$1at *'); -} - describe('errors output', { concurrency: !process.env.TEST_PARALLEL }, () => { - function normalizeNoNumbers(str) { - return str.replaceAll(/\d+:\d+/g, '*:*').replaceAll(/:\d+/g, ':*').replaceAll('*fixtures*message*', '*'); - } - const defaultTransform = snapshot.transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - ); - const errTransform = snapshot.transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - normalizeNoNumbers, - ); - const promiseTransform = snapshot.transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - replaceStackTrace, - normalizeNoNumbers, - ); - const forceColorsTransform = snapshot.transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - replaceForceColorsStackTrace, - ); - const tests = [ { name: 'errors/async_error_eval_cjs.js' }, { name: 'errors/async_error_eval_esm.js' }, @@ -51,33 +17,36 @@ describe('errors output', { concurrency: !process.env.TEST_PARALLEL }, () => { { name: 'errors/core_line_numbers.js' }, { name: 'errors/async_error_sync_esm.mjs' }, { name: 'errors/test-no-extra-info-on-fatal-exception.js' }, - { name: 'errors/error_aggregateTwoErrors.js', transform: errTransform }, - { name: 'errors/error_exit.js', transform: errTransform }, - { name: 'errors/error_with_nul.js', transform: errTransform }, - { name: 'errors/events_unhandled_error_common_trace.js', transform: errTransform }, - { name: 'errors/events_unhandled_error_nexttick.js', transform: errTransform }, - { name: 'errors/events_unhandled_error_sameline.js', transform: errTransform }, - { name: 'errors/events_unhandled_error_subclass.js', transform: errTransform }, - { name: 'errors/if-error-has-good-stack.js', transform: errTransform }, - { name: 'errors/throw_custom_error.js', transform: errTransform }, - { name: 'errors/throw_error_with_getter_throw.js', transform: errTransform }, - { name: 'errors/throw_in_eval_anonymous.js', transform: errTransform }, - { name: 'errors/throw_in_eval_named.js', transform: errTransform }, - { name: 'errors/throw_in_line_with_tabs.js', transform: errTransform }, - { name: 'errors/throw_non_error.js', transform: errTransform }, - { name: 'errors/throw_null.js', transform: errTransform }, - { name: 'errors/throw_undefined.js', transform: errTransform }, - { name: 'errors/timeout_throw.js', transform: errTransform }, - { name: 'errors/undefined_reference_in_new_context.js', transform: errTransform }, - { name: 'errors/promise_always_throw_unhandled.js', transform: promiseTransform }, - { name: 'errors/promise_unhandled_warn_with_error.js', transform: promiseTransform }, - { name: 'errors/unhandled_promise_trace_warnings.js', transform: promiseTransform }, - { skip: skipForceColors, name: 'errors/force_colors.js', - transform: forceColorsTransform, env: { FORCE_COLOR: 1 } }, + { name: 'errors/error_aggregateTwoErrors.js' }, + { name: 'errors/error_exit.js' }, + { name: 'errors/error_with_nul.js' }, + { name: 'errors/events_unhandled_error_common_trace.js' }, + { name: 'errors/events_unhandled_error_nexttick.js' }, + { name: 'errors/events_unhandled_error_sameline.js' }, + { name: 'errors/events_unhandled_error_subclass.js' }, + { name: 'errors/if-error-has-good-stack.js' }, + { name: 'errors/throw_custom_error.js' }, + { name: 'errors/throw_error_with_getter_throw.js' }, + { name: 'errors/throw_in_eval_anonymous.js' }, + { name: 'errors/throw_in_eval_named.js' }, + { name: 'errors/throw_in_line_with_tabs.js' }, + { name: 'errors/throw_non_error.js' }, + { name: 'errors/throw_null.js' }, + { name: 'errors/throw_undefined.js' }, + { name: 'errors/timeout_throw.js' }, + { name: 'errors/undefined_reference_in_new_context.js' }, + { name: 'errors/promise_always_throw_unhandled.js' }, + { name: 'errors/promise_unhandled_warn_with_error.js' }, + { name: 'errors/unhandled_promise_trace_warnings.js' }, + { skip: skipForceColors, name: 'errors/force_colors.js', env: { FORCE_COLOR: 1 } }, ]; - for (const { name, transform = defaultTransform, env, skip = false } of tests) { + for (const { name, env, skip = false } of tests) { it(name, { skip }, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), transform, { env: { ...env, ...process.env } }); + await snapshot.spawnAndAssert( + fixtures.path(name), + snapshot.defaultTransform, + { env: { ...env, ...process.env } } + ); }); } }); diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs index 0dc97ac9f32e42..e064b47073f6aa 100644 --- a/test/parallel/test-node-output-eval.mjs +++ b/test/parallel/test-node-output-eval.mjs @@ -7,22 +7,6 @@ import * as snapshot from '../common/assertSnapshot.js'; import { describe, it } from 'node:test'; describe('eval output', { concurrency: true }, () => { - function normalize(str) { - return str - .replaceAll(/\d+:\d+/g, '*:*'); - } - - const defaultTransform = snapshot.transform( - normalize, - snapshot.basicTransform, - snapshot.transformProjectRoot(), - removeStackTraces, - ); - - function removeStackTraces(output) { - return output.replaceAll(/^ *at .+$/gm, ''); - } - const tests = [ { name: 'eval/eval_messages.js' }, { name: 'eval/stdin_messages.js' }, @@ -32,7 +16,7 @@ describe('eval output', { concurrency: true }, () => { for (const { name } of tests) { it(name, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); + await snapshot.spawnAndAssert(fixtures.path(name), snapshot.defaultTransform); }); } }); diff --git a/test/parallel/test-node-output-sourcemaps.mjs b/test/parallel/test-node-output-sourcemaps.mjs index 2341d66e628746..840ca7cf59a47c 100644 --- a/test/parallel/test-node-output-sourcemaps.mjs +++ b/test/parallel/test-node-output-sourcemaps.mjs @@ -4,13 +4,6 @@ import * as snapshot from '../common/assertSnapshot.js'; import { describe, it } from 'node:test'; describe('sourcemaps output', { concurrency: !process.env.TEST_PARALLEL }, () => { - const defaultTransform = snapshot - .transform( - snapshot.basicTransform, - snapshot.transformProjectRoot(), - snapshot.replaceInternalStackTrace, - ); - const tests = [ { name: 'source-map/output/source_map_assert_source_line.ts' }, { name: 'source-map/output/source_map_disabled_by_api.js' }, @@ -35,7 +28,7 @@ describe('sourcemaps output', { concurrency: !process.env.TEST_PARALLEL }, () => for (const { name } of tests) { const skip = name.endsWith('.ts') && !process.config.variables.node_use_amaro; it(name, { skip }, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); + await snapshot.spawnAndAssert(fixtures.path(name), snapshot.defaultTransform); }); } }); diff --git a/test/parallel/test-node-output-v8-warning.mjs b/test/parallel/test-node-output-v8-warning.mjs index f342ef1d4f8db9..43f6709dc248c7 100644 --- a/test/parallel/test-node-output-v8-warning.mjs +++ b/test/parallel/test-node-output-v8-warning.mjs @@ -4,16 +4,12 @@ import * as snapshot from '../common/assertSnapshot.js'; import { describe, it } from 'node:test'; describe('v8 output', { concurrency: !process.env.TEST_PARALLEL }, () => { - function normalize(str) { - return str.replaceAll(/:\d+/g, ':*'); - } - const defaultTransform = snapshot.transform(snapshot.basicTransform, snapshot.transformProjectRoot(), normalize); const tests = [ { name: 'v8/v8_warning.js' }, ]; for (const { name } of tests) { it(name, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); + await snapshot.spawnAndAssert(fixtures.path(name), snapshot.defaultTransform); }); } }); diff --git a/test/parallel/test-node-output-vm.mjs b/test/parallel/test-node-output-vm.mjs index 9a285d9ca0f006..f87e66a8bc5df3 100644 --- a/test/parallel/test-node-output-vm.mjs +++ b/test/parallel/test-node-output-vm.mjs @@ -4,13 +4,6 @@ import * as snapshot from '../common/assertSnapshot.js'; import { describe, it } from 'node:test'; describe('vm output', { concurrency: !process.env.TEST_PARALLEL }, () => { - function normalize(str) { - return str.replaceAll(/node:vm:\d+:\d+/g, 'node:vm:*'); - } - - const defaultTransform = snapshot - .transform(snapshot.basicTransform, snapshot.transformProjectRoot(), normalize); - const tests = [ { name: 'vm/vm_caught_custom_runtime_error.js' }, { name: 'vm/vm_display_runtime_error.js' }, @@ -20,7 +13,7 @@ describe('vm output', { concurrency: !process.env.TEST_PARALLEL }, () => { ]; for (const { name } of tests) { it(name, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform); + await snapshot.spawnAndAssert(fixtures.path(name), snapshot.defaultTransform); }); } }); diff --git a/test/test-runner/test-output-tap-escape.mjs b/test/test-runner/test-output-tap-escape.mjs index f0b4471d5158bb..794e0fe94558f3 100644 --- a/test/test-runner/test-output-tap-escape.mjs +++ b/test/test-runner/test-output-tap-escape.mjs @@ -3,15 +3,13 @@ import '../common/index.mjs'; import * as fixtures from '../common/fixtures.mjs'; import { spawnAndAssert, - transform, - replaceWindowsLineEndings, - replaceTestDuration, + defaultTransform, ensureCwdIsProjectRoot, } from '../common/assertSnapshot.js'; ensureCwdIsProjectRoot(); await spawnAndAssert( fixtures.path('test-runner/output/tap_escape.js'), - transform(replaceWindowsLineEndings, replaceTestDuration), + defaultTransform, { flags: ['--test-reporter=tap'] }, );