-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
test: unify assertSnapshot common patterns #61590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nodejs-github-bot
merged 3 commits into
nodejs:main
from
legendecas:test-snapshot-version
Feb 2, 2026
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| before | ||
| *test*fixtures*console*stack_overflow.js:* | ||
| /test/fixtures/console/stack_overflow.js:* | ||
| JSON.stringify(array); | ||
| ^ | ||
|
|
||
| [RangeError: Maximum call stack size exceeded] | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Error: test | ||
| at one (file:*/[eval1]:2:9) | ||
| at two (file:*/[eval1]:15:9) | ||
| at async three (file:*/[eval1]:18:3) | ||
| at async four (file:*/[eval1]:22:3) | ||
| at async main (file:*/[eval1]:28:5) | ||
| at one (file:///[eval1]:2:9) | ||
| at two (file:///[eval1]:15:9) | ||
| at async three (file:///[eval1]:18:3) | ||
| at async four (file:///[eval1]:22:3) | ||
| at async main (file:///[eval1]:28:5) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| Error: test | ||
| at one (*fixtures*async-error.js:4:9) | ||
| at two (*fixtures*async-error.js:17:9) | ||
| at async three (*fixtures*async-error.js:20:3) | ||
| at async four (*fixtures*async-error.js:24:3) | ||
| at async main (*async_error_microtask_main.js:7:5) | ||
| at one (/test/fixtures/async-error.js:4:9) | ||
| at two (/test/fixtures/async-error.js:17:9) | ||
| 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_microtask_main.js:7:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Error: test | ||
| at one (*fixtures*async-error.js:4:9) | ||
| at two (*fixtures*async-error.js:17:9) | ||
| at process.processTicksAndRejections (node:internal*process*task_queues:104:5) | ||
| at async three (*fixtures*async-error.js:20:3) | ||
| at async four (*fixtures*async-error.js:24:3) | ||
| at async main (*async_error_nexttick_main.js:7:5) | ||
| 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 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| Error: test | ||
| at one (*fixtures*async-error.js:4:9) | ||
| at two (*fixtures*async-error.js:17:9) | ||
| at async three (*fixtures*async-error.js:20:3) | ||
| at async four (*fixtures*async-error.js:24:3) | ||
| at async main (file:*/async_error_sync_esm.mjs:6:5) | ||
| at one (/test/fixtures/async-error.js:4:9) | ||
| at two (/test/fixtures/async-error.js:17:9) | ||
| at async three (/test/fixtures/async-error.js:20:3) | ||
| at async four (/test/fixtures/async-error.js:24:3) | ||
| at async main (file:///test/fixtures/errors/async_error_sync_esm.mjs:6:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| Error: test | ||
| at one (*fixtures*async-error.js:4:9) | ||
| at two (*fixtures*async-error.js:17:9) | ||
| at async three (*fixtures*async-error.js:20:3) | ||
| at async four (*fixtures*async-error.js:24:3) | ||
| at async main (*async_error_sync_main.js:7:5) | ||
| at one (/test/fixtures/async-error.js:4:9) | ||
| at two (/test/fixtures/async-error.js:17:9) | ||
| 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_sync_main.js:7:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| *error_aggregateTwoErrors.js:* | ||
| /test/fixtures/errors/error_aggregateTwoErrors.js:* | ||
| throw aggregateTwoErrors(err, originalError); | ||
| ^ | ||
|
|
||
| AggregateError: original | ||
| at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) { | ||
| at Object.<anonymous> (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { | ||
| code: 'ERR0', | ||
| [errors]: [ | ||
| Error: original | ||
| at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) { | ||
| at Object.<anonymous> (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { | ||
| code: 'ERR0' | ||
| }, | ||
| Error: second error | ||
| at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) { | ||
| at Object.<anonymous> (/test/fixtures/errors/error_aggregateTwoErrors.js:*:*) { | ||
| code: 'ERR1' | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
12 changes: 6 additions & 6 deletions
12
test/fixtures/errors/events_unhandled_error_common_trace.snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| node:events:* | ||
| throw er; * Unhandled 'error' event | ||
| throw er; // Unhandled 'error' event | ||
| ^ | ||
|
|
||
| Error: foo:bar | ||
| at bar (*events_unhandled_error_common_trace.js:*:*) | ||
| at foo (*events_unhandled_error_common_trace.js:*:*) | ||
| at bar (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) | ||
| at foo (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) | ||
| Emitted 'error' event at: | ||
| at quux (*events_unhandled_error_common_trace.js:*:*) | ||
| at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*) | ||
| at quux (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_common_trace.js:*:*) | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
8 changes: 4 additions & 4 deletions
8
test/fixtures/errors/events_unhandled_error_nexttick.snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| node:events:* | ||
| throw er; * Unhandled 'error' event | ||
| throw er; // Unhandled 'error' event | ||
| ^ | ||
|
|
||
| Error | ||
| at Object.<anonymous> (*events_unhandled_error_nexttick.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_nexttick.js:*:*) | ||
| Emitted 'error' event at: | ||
| at *events_unhandled_error_nexttick.js:*:* | ||
| at /test/fixtures/errors/events_unhandled_error_nexttick.js:*:* | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
8 changes: 4 additions & 4 deletions
8
test/fixtures/errors/events_unhandled_error_sameline.snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| node:events:* | ||
| throw er; * Unhandled 'error' event | ||
| throw er; // Unhandled 'error' event | ||
| ^ | ||
|
|
||
| Error | ||
| at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_sameline.js:*:*) | ||
| Emitted 'error' event at: | ||
| at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_sameline.js:*:*) | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
8 changes: 4 additions & 4 deletions
8
test/fixtures/errors/events_unhandled_error_subclass.snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| node:events:* | ||
| throw er; * Unhandled 'error' event | ||
| throw er; // Unhandled 'error' event | ||
| ^ | ||
|
|
||
| Error | ||
| at Object.<anonymous> (*events_unhandled_error_subclass.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_subclass.js:*:*) | ||
| Emitted 'error' event on Foo instance at: | ||
| at Object.<anonymous> (*events_unhandled_error_subclass.js:*:*) | ||
| at Object.<anonymous> (/test/fixtures/errors/events_unhandled_error_subclass.js:*:*) | ||
|
|
||
| Node.js * | ||
| Node.js <node-version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/fixtures/errors/test-no-extra-info-on-fatal-exception.snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| *test-no-extra-info-on-fatal-exception.js:7 | ||
| /test/fixtures/errors/test-no-extra-info-on-fatal-exception.js:7 | ||
| throw new Error('foo'); | ||
| ^ | ||
|
|
||
| Error: foo | ||
| at Object.<anonymous> (*test-no-extra-info-on-fatal-exception.js:7:7) | ||
| at Object.<anonymous> (/test/fixtures/errors/test-no-extra-info-on-fatal-exception.js:7:7) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.