From 8d17393258f36d09874ac7af265b580e0a16ec96 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 23 Dec 2024 17:31:23 +0100 Subject: [PATCH] fixup --- test/fixtures/eval/eval_messages.snapshot | 59 ++++++++-------- test/fixtures/eval/stdin_messages.snapshot | 80 +++++++++++----------- test/parallel/test-node-output-eval.mjs | 5 ++ 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot index fae560323f96f1..6a37ad22634617 100644 --- a/test/fixtures/eval/eval_messages.snapshot +++ b/test/fixtures/eval/eval_messages.snapshot @@ -4,14 +4,12 @@ with(this){__filename} ^^^^ SyntaxError: Strict mode code may not include a with statement - at new Script (node:vm:*:*) - at createScript (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [eval]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_string:*:* + + + + + + Node.js * 42 @@ -21,14 +19,13 @@ throw new Error("hello") ^ Error: hello - at [eval]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [eval]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_string:*:* + + + + + + + Node.js * [eval]:1 @@ -36,14 +33,13 @@ throw new Error("hello") ^ Error: hello - at [eval]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [eval]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_string:*:* + + + + + + + Node.js * 100 @@ -52,14 +48,13 @@ var x = 100; y = x; ^ ReferenceError: y is not defined - at [eval]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [eval]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_string:*:* + + + + + + + Node.js * diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot index a5a748fc17cb3a..3c03bd64072061 100644 --- a/test/fixtures/eval/stdin_messages.snapshot +++ b/test/fixtures/eval/stdin_messages.snapshot @@ -4,16 +4,16 @@ with(this){__filename} ^^^^ SyntaxError: Strict mode code may not include a with statement - at new Script (node:vm:*:*) - at createScript (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [stdin]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_stdin:*:* - at Socket. (node:internal/process/execution:*:*) - at Socket.emit (node:events:*:*) + + + + + + + + + + Node.js * 42 @@ -23,16 +23,16 @@ throw new Error("hello") ^ Error: hello - at [stdin]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [stdin]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_stdin:*:* - at Socket. (node:internal/process/execution:*:*) - at Socket.emit (node:events:*:*) + + + + + + + + + + Node.js * [stdin]:1 @@ -40,16 +40,16 @@ throw new Error("hello") ^ Error: hello - at [stdin]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [stdin]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_stdin:*:* - at Socket. (node:internal/process/execution:*:*) - at Socket.emit (node:events:*:*) + + + + + + + + + + Node.js * 100 @@ -58,16 +58,16 @@ let x = 100; y = x; ^ ReferenceError: y is not defined - at [stdin]:*:* - at Script.runInThisContext (node:vm:*:*) - at Object.runInThisContext (node:vm:*:*) - at node:internal/process/execution:*:* - at [stdin]-wrapper:*:* - at runScript (node:internal/process/execution:*:*) - at evalScript (node:internal/process/execution:*:*) - at node:internal/main/eval_stdin:*:* - at Socket. (node:internal/process/execution:*:*) - at Socket.emit (node:events:*:*) + + + + + + + + + + Node.js * diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs index a0b55e3d8dae9b..2fa60206e1ea1c 100644 --- a/test/parallel/test-node-output-eval.mjs +++ b/test/parallel/test-node-output-eval.mjs @@ -10,12 +10,17 @@ describe('eval output', { concurrency: true }, () => { } const defaultTransform = snapshot.transform( + removeStackTraces, normalize, snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, snapshot.replaceNodeVersion ); + function removeStackTraces(output) { + return output.replaceAll(/^ *at .+$/gm, ''); + } + const tests = [ { name: 'eval/eval_messages.js' }, { name: 'eval/stdin_messages.js' },