Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: remove empty lines from snapshots
  • Loading branch information
marco-ippolito committed Dec 30, 2024
commit a5a7b5616fb96332ee32db340ed43ceefc45ce2b
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