Skip to content

Commit

Permalink
test: fix (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored May 8, 2024
1 parent 050e19c commit 4b895aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/JsonMinimizerPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ describe("JsonMinimizerPlugin", () => {
`Error: "broken-json-syntax.json" in "/test/fixtures" from Json Minimizer:`,
);

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(statsErrors[0]).toContain(
`SyntaxError: Expected property name or '}' in JSON at position 4`,
);
Expand Down

0 comments on commit 4b895aa

Please sign in to comment.