|
1 | 1 | import { mustCall } from '../common/index.mjs'; |
2 | 2 | import { fileURL } from '../common/fixtures.mjs'; |
3 | | -import { ok, strictEqual } from 'assert'; |
| 3 | +import { match, strictEqual } from 'assert'; |
4 | 4 | import { spawn } from 'child_process'; |
5 | 5 | import { execPath } from 'process'; |
6 | 6 |
|
7 | 7 | // Verify experimental warnings are printed |
8 | 8 | for ( |
9 | 9 | const [experiment, arg] of [ |
10 | | - ['Custom ESM Loaders', `--experimental-loader=${fileURL('es-module-loaders', 'hooks-custom.mjs')}`], |
11 | | - ['Network Imports', '--experimental-network-imports'], |
12 | | - ['Specifier Resolution', '--experimental-specifier-resolution=node'], |
| 10 | + [/Custom ESM Loaders/, `--experimental-loader=${fileURL('es-module-loaders', 'hooks-custom.mjs')}`], |
| 11 | + [/Network Imports/, '--experimental-network-imports'], |
| 12 | + [/Specifier Resolution/, '--experimental-specifier-resolution=node'], |
13 | 13 | ] |
14 | 14 | ) { |
15 | 15 | const child = spawn(execPath, [ |
|
25 | 25 | child.on('close', mustCall((code, signal) => { |
26 | 26 | strictEqual(code, 0); |
27 | 27 | 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, experiment); |
30 | 30 | })); |
31 | 31 | } |
0 commit comments