Skip to content

Commit

Permalink
test: mask node version in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 4, 2023
1 parent 37e0692 commit 64cf136
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/__snapshots__/fixtures.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Error: ParseError: \`import\` can only be used in \`import
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main)
at internal/main/run_main_module
Node.js v18.16.0"
Node.js v<version>"
`;
exports[`fixtures > error-parse > stdout 1`] = `""`;
Expand All @@ -50,7 +50,7 @@ TypeError: The \\"listener\\" argument must be of type function. Received undefi
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v18.16.0"
Node.js v<version>"
`;
exports[`fixtures > error-runtime > stdout 1`] = `""`;
Expand Down
1 change: 1 addition & 0 deletions test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("fixtures", async () => {
.replace(/node:(internal|events)/g, "$1") // in Node 16 internal will be presented as node:internal
.replace(/\.js\)/g, ")")
.replace(/file:\/{3}/g, "file://")
.replace(/Node.js v[0-9.]+/, "Node.js v<version>")

Check failure on line 32 in test/fixtures.test.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

/Node.js v[0-9.]+/ can be optimized to /Node.js v[\d.]+/

Check failure on line 32 in test/fixtures.test.ts

View workflow job for this annotation

GitHub Actions / ci (windows-latest, 18)

/Node.js v[0-9.]+/ can be optimized to /Node.js v[\d.]+/
.replace(/ParseError: \w:\/:\s+/, "ParseError: ") // Unknown chars in Windows
.trim();
}
Expand Down

0 comments on commit 64cf136

Please sign in to comment.