diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot index bed167424483a1..845ff4999be542 100644 --- a/test/fixtures/eval/eval_messages.snapshot +++ b/test/fixtures/eval/eval_messages.snapshot @@ -40,7 +40,7 @@ Node.js * var ______________________________________________; throw 10 ^ 10 -(Use `node --trace-uncaught ...` to show where the exception was thrown) +(Use `* --trace-uncaught ...` to show where the exception was thrown) Node.js * @@ -48,7 +48,7 @@ Node.js * var ______________________________________________; throw 10 ^ 10 -(Use `node --trace-uncaught ...` to show where the exception was thrown) +(Use `* --trace-uncaught ...` to show where the exception was thrown) Node.js * done diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot index 66bd506f758ca9..0382a6ae3ccd79 100644 --- a/test/fixtures/eval/stdin_messages.snapshot +++ b/test/fixtures/eval/stdin_messages.snapshot @@ -40,7 +40,7 @@ Node.js * let ______________________________________________; throw 10 ^ 10 -(Use `node --trace-uncaught ...` to show where the exception was thrown) +(Use `* --trace-uncaught ...` to show where the exception was thrown) Node.js * @@ -48,7 +48,7 @@ Node.js * let ______________________________________________; throw 10 ^ 10 -(Use `node --trace-uncaught ...` to show where the exception was thrown) +(Use `* --trace-uncaught ...` to show where the exception was thrown) Node.js * done diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs index d8c52176b1c3c3..8a3cc595742067 100644 --- a/test/parallel/test-node-output-eval.mjs +++ b/test/parallel/test-node-output-eval.mjs @@ -1,6 +1,7 @@ import '../common/index.mjs'; import * as fixtures from '../common/fixtures.mjs'; import * as snapshot from '../common/assertSnapshot.js'; +import { basename } from 'node:path'; import { describe, it } from 'node:test'; describe('eval output', { concurrency: true }, () => { @@ -16,6 +17,7 @@ describe('eval output', { concurrency: true }, () => { snapshot.replaceNodeVersion, removeStackTraces, filterEmptyLines, + generalizeProcessName, ); function removeStackTraces(output) { @@ -26,6 +28,11 @@ describe('eval output', { concurrency: true }, () => { return output.replaceAll(/^\s*$/gm, ''); } + function generalizeProcessName(output) { + const baseName = basename(process.argv0 || 'node', '.exe'); + return output.replaceAll(`${baseName} --`, '* --'); + } + const tests = [ { name: 'eval/eval_messages.js' }, { name: 'eval/stdin_messages.js' },