Skip to content

Commit ffb25b8

Browse files
authored
test: replace diagnostics_channel stackframe in output snapshots
PR-URL: #60024 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 85b0e06 commit ffb25b8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/common/assertSnapshot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ function replaceStackTrace(str, replacement = '$1*$7$8\n') {
1717
}
1818

1919
function replaceInternalStackTrace(str) {
20-
return str.replaceAll(/(\W+).*node:internal.*/g, '$1*');
20+
// Replace non-internal frame `at TracingChannel.traceSync (node:diagnostics_channel:328:14)`
21+
// as well as `at node:internal/main/run_main_module:33:47` with `*`.
22+
return str.replaceAll(/(\W+).*[(\s]node:.*/g, '$1*');
2123
}
2224

2325
function replaceWindowsLineEndings(str) {

test/fixtures/source-map/output/source_map_assert_source_line.snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
77
*
88
*
99
*
10-
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
10+
*
1111
*
1212
*
1313
*

0 commit comments

Comments
 (0)