test: replace diagnostics_channel stackframe in output snapshots

PR-URL: https://github.com/nodejs/node/pull/60024
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Chengzhong Wu authored and Michaël Zasso committed 2025-10-06 16:26:12 +02:00
1 parent b865074641
commit 5538cfc1e8
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -17,7 +17,9 @@ function replaceStackTrace(str, replacement = '$1*$7$8\n') {
}
function replaceInternalStackTrace(str) {
return str.replaceAll(/(\W+).*node:internal.*/g, '$1*');
// 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*');
}
function replaceWindowsLineEndings(str) {
@@ -7,7 +7,7 @@ AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
*
*
*
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
*
*
*
*