Skip to content

Commit bc74a37

Browse files
committed
fixup! test: use assert.match for non-literal regexp tests
1 parent 45f3a42 commit bc74a37

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

test/parallel/test-max-old-space-size-percentage.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ invalidPercentages.forEach((input) => {
4141
`--max-old-space-size-percentage=${input[0]}`,
4242
], { stdio: ['pipe', 'pipe', 'pipe'] });
4343
assert.notStrictEqual(result.status, 0, `Expected non-zero exit for invalid input ${input[0]}`);
44-
assert.match(
45-
result.stderr.toString(),
46-
input[1],
47-
`Unexpected error message for invalid input ${input[0]}`
48-
);
44+
assert.match(result.stderr.toString(), input[1]);
4945
});
5046

5147
// Test NODE_OPTIONS with valid percentages
@@ -65,11 +61,7 @@ invalidPercentages.forEach((input) => {
6561
env: { ...process.env, NODE_OPTIONS: `--max-old-space-size-percentage=${input[0]}` }
6662
});
6763
assert.notStrictEqual(result.status, 0, `NODE_OPTIONS: Expected non-zero exit for invalid input ${input[0]}`);
68-
assert.match(
69-
result.stderr.toString(),
70-
input[1],
71-
`NODE_OPTIONS: Unexpected error message for invalid input ${input[0]}`
72-
);
64+
assert.match(result.stderr.toString(), input[1]);
7365
});
7466

7567
// Test percentage calculation validation

0 commit comments

Comments
 (0)