Skip to content

Commit

Permalink
test: remove empty lines from snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Dec 24, 2024
1 parent da3f388 commit f263f51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 68 deletions.
28 changes: 0 additions & 28 deletions test/fixtures/eval/eval_messages.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ with(this){__filename}

SyntaxError: Strict mode code may not include a with statement








Node.js *
42
42
Expand All @@ -21,27 +14,13 @@ throw new Error("hello")

Error: hello








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

Error: hello








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

ReferenceError: y is not defined








Node.js *

[eval]:1
Expand Down
40 changes: 0 additions & 40 deletions test/fixtures/eval/stdin_messages.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ with(this){__filename}

SyntaxError: Strict mode code may not include a with statement











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

Error: hello











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

Error: hello











Node.js *
100
[stdin]:1
Expand All @@ -59,16 +29,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 f263f51

Please sign in to comment.