Skip to content

Commit 13d7ff2

Browse files
Merge branch 'master' into use-node-v22
2 parents dc7e059 + 960e620 commit 13d7ff2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/loader.test.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,15 @@ describe("source-map-loader", () => {
264264
dependencies.forEach((fixture) => {
265265
expect(deps.has(fixture)).toBe(true);
266266
});
267+
267268
expect(codeFromBundle.map).toBeUndefined();
268269
expect(codeFromBundle.code).toMatchSnapshot("code");
269270

270-
if (
271-
process.version.startsWith("v20") ||
272-
process.version.startsWith("v21")
273-
) {
271+
const match = process.version.match(
272+
/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/,
273+
);
274+
275+
if (parseInt(match[1], 10) >= 20) {
274276
expect(getWarnings(stats)[0]).toContain(
275277
`SyntaxError: Unexpected non-whitespace character after JSON at position 102`,
276278
);

0 commit comments

Comments
 (0)