From 0e04aea54ff6d8c8e2e54ebf6b4e7bc7623cb140 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 24 Dec 2024 17:55:56 +0100 Subject: [PATCH] test: remove empty lines from snapshots PR-URL: https://github.com/nodejs/node/pull/56358 Reviewed-By: James M Snell Reviewed-By: Yagiz Nizipli Reviewed-By: Jacob Smith --- test/fixtures/eval/eval_messages.snapshot | 21 ------------ test/fixtures/eval/stdin_messages.snapshot | 38 ---------------------- test/parallel/test-node-output-eval.mjs | 5 +++ 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot index e3976d69fd93b3..91ae27b4215626 100644 --- a/test/fixtures/eval/eval_messages.snapshot +++ b/test/fixtures/eval/eval_messages.snapshot @@ -27,13 +27,6 @@ throw new Error("hello") Error: hello - - - - - - - Node.js * [eval]:1 throw new Error("hello") @@ -41,13 +34,6 @@ throw new Error("hello") Error: hello - - - - - - - Node.js * 100 [eval]:1 @@ -56,13 +42,6 @@ var x = 100; y = x; ReferenceError: y is not defined - - - - - - - Node.js * [eval]:1 diff --git a/test/fixtures/eval/stdin_messages.snapshot b/test/fixtures/eval/stdin_messages.snapshot index 27f5851eb94a4f..ff8b6a05d805cb 100644 --- a/test/fixtures/eval/stdin_messages.snapshot +++ b/test/fixtures/eval/stdin_messages.snapshot @@ -14,14 +14,6 @@ Caused by: SyntaxError: Strict mode code may not include a with statement - - - - - - - - Node.js * 42 42 @@ -31,16 +23,6 @@ throw new Error("hello") Error: hello - - - - - - - - - - Node.js * [stdin]:1 throw new Error("hello") @@ -48,16 +30,6 @@ throw new Error("hello") Error: hello - - - - - - - - - - Node.js * 100 [stdin]:1 @@ -66,16 +38,6 @@ let x = 100; y = x; ReferenceError: y is not defined - - - - - - - - - - Node.js * [stdin]:1 diff --git a/test/parallel/test-node-output-eval.mjs b/test/parallel/test-node-output-eval.mjs index a8bfd730e92cf4..cd22cbfea28cd6 100644 --- a/test/parallel/test-node-output-eval.mjs +++ b/test/parallel/test-node-output-eval.mjs @@ -11,6 +11,7 @@ describe('eval output', { concurrency: true }, () => { const defaultTransform = snapshot.transform( removeStackTraces, + filterEmptyLines, normalize, snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, @@ -21,6 +22,10 @@ describe('eval output', { concurrency: true }, () => { return output.replaceAll(/^ *at .+$/gm, ''); } + function filterEmptyLines(output) { + return output.replaceAll(/^\s*$/gm, ''); + } + const tests = [ { name: 'eval/eval_messages.js' }, { name: 'eval/stdin_messages.js' },