Skip to content

Commit bc5f0a4

Browse files
fixup: switch test from substring to regex
1 parent c1f74b1 commit bc5f0a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/es-module/test-esm-experimental-warnings.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mustCall } from '../common/index.mjs';
22
import { fileURL } from '../common/fixtures.mjs';
3-
import { ok, strictEqual } from 'assert';
3+
import { match, strictEqual } from 'assert';
44
import { spawn } from 'child_process';
55
import { execPath } from 'process';
66

@@ -25,7 +25,7 @@ for (
2525
child.on('close', mustCall((code, signal) => {
2626
strictEqual(code, 0);
2727
strictEqual(signal, null);
28-
ok(stderr.includes('ExperimentalWarning:'));
29-
ok(stderr.includes(experiment), new Error(`Expected warning to mention ${experiment}`));
28+
match(stderr, /ExperimentalWarning:/);
29+
match(stderr, new RegExp(experiment));
3030
}));
3131
}

0 commit comments

Comments
 (0)