test: remove empty lines from snapshots

PR-URL: https://github.com/nodejs/node/pull/56358
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
This commit is contained in:
Marco Ippolito
2024-12-24 17:55:56 +01:00
committed by Node.js GitHub Bot
parent d2af881997
commit 0e04aea54f
3 changed files with 5 additions and 59 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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' },