Skip to content

Commit

Permalink
test: fix (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed May 8, 2024
1 parent 3e0a779 commit 960e620
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,15 @@ describe("source-map-loader", () => {
dependencies.forEach((fixture) => {
expect(deps.has(fixture)).toBe(true);
});

expect(codeFromBundle.map).toBeUndefined();
expect(codeFromBundle.code).toMatchSnapshot("code");

if (
process.version.startsWith("v20") ||
process.version.startsWith("v21")
) {
const match = process.version.match(
/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/,
);

if (parseInt(match[1], 10) >= 20) {
expect(getWarnings(stats)[0]).toContain(
`SyntaxError: Unexpected non-whitespace character after JSON at position 102`,
);
Expand Down

0 comments on commit 960e620

Please sign in to comment.