Skip to content

Commit 8092730

Browse files
Merge branch 'master' into use-node-v22
2 parents e372316 + 4b895aa commit 8092730

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/JsonMinimizerPlugin.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ describe("JsonMinimizerPlugin", () => {
108108
`Error: "broken-json-syntax.json" in "/test/fixtures" from Json Minimizer:`,
109109
);
110110

111-
if (
112-
process.version.startsWith("v20") ||
113-
process.version.startsWith("v21")
114-
) {
111+
const match = process.version.match(
112+
/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/,
113+
);
114+
115+
if (parseInt(match[1], 10) >= 20) {
115116
expect(statsErrors[0]).toContain(
116117
`SyntaxError: Expected property name or '}' in JSON at position 4`,
117118
);

0 commit comments

Comments
 (0)