From f263f513d9c1933b7c10dc0cdf1e289a1bb67f7a 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 --- test/fixtures/eval/eval_messages.snapshot | 28 --------------- test/fixtures/eval/stdin_messages.snapshot | 40 ---------------------- test/parallel/test-node-output-eval.mjs | 5 +++ 3 files changed, 5 insertions(+), 68 deletions(-) diff --git a/test/fixtures/eval/eval_messages.snapshot b/test/fixtures/eval/eval_messages.snapshot index 4b4069219f03fb..f6fc803e0e3ec3 100644 --- a/test/fixtures/eval/eval_messages.snapshot +++ b/test/fixtures/eval/eval_messages.snapshot @@ -5,13 +5,6 @@ with(this){__filename} SyntaxError: Strict mode code may not include a with statement - - - - - - - Node.js * 42 42 @@ -21,13 +14,6 @@ throw new Error("hello") Error: hello - - - - - - - Node.js * [eval]:1 throw new Error("hello") @@ -35,13 +21,6 @@ throw new Error("hello") Error: hello - - - - - - - Node.js * 100 [eval]:1 @@ -50,13 +29,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 3c03bd64072061..42db3da829affb 100644 --- a/test/fixtures/eval/stdin_messages.snapshot +++ b/test/fixtures/eval/stdin_messages.snapshot @@ -5,16 +5,6 @@ with(this){__filename} SyntaxError: Strict mode code may not include a with statement - - - - - - - - - - Node.js * 42 42 @@ -24,16 +14,6 @@ throw new Error("hello") Error: hello - - - - - - - - - - Node.js * [stdin]:1 throw new Error("hello") @@ -41,16 +21,6 @@ throw new Error("hello") Error: hello - - - - - - - - - - Node.js * 100 [stdin]:1 @@ -59,16 +29,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 2fa60206e1ea1c..9434281c313e4c 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' },