Skip to content

Commit

Permalink
test: remove empty lines from snapshots
Browse files Browse the repository at this point in the history
PR-URL: #56358
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
  • Loading branch information
marco-ippolito authored and nodejs-github-bot committed Dec 30, 2024
1 parent d2af881 commit 0e04aea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 59 deletions.
21 changes: 0 additions & 21 deletions test/fixtures/eval/eval_messages.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,13 @@ throw new Error("hello")

Error: hello








Node.js *
[eval]:1
throw new Error("hello")
^

Error: hello








Node.js *
100
[eval]:1
Expand All @@ -56,13 +42,6 @@ var x = 100; y = x;

ReferenceError: y is not defined








Node.js *

[eval]:1
Expand Down
38 changes: 0 additions & 38 deletions test/fixtures/eval/stdin_messages.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ Caused by:

SyntaxError: Strict mode code may not include a with statement









Node.js *
42
42
Expand All @@ -31,33 +23,13 @@ throw new Error("hello")

Error: hello











Node.js *
[stdin]:1
throw new Error("hello")
^

Error: hello











Node.js *
100
[stdin]:1
Expand All @@ -66,16 +38,6 @@ let x = 100; y = x;

ReferenceError: y is not defined











Node.js *

[stdin]:1
Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-node-output-eval.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('eval output', { concurrency: true }, () => {

const defaultTransform = snapshot.transform(
removeStackTraces,
filterEmptyLines,
normalize,
snapshot.replaceWindowsLineEndings,
snapshot.replaceWindowsPaths,
Expand All @@ -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' },
Expand Down

0 comments on commit 0e04aea

Please sign in to comment.