(args, options = {}, expected = {})
| 6 | |
| 7 | // Helper function to assert the spawned process |
| 8 | async function assertSpawnedProcess(args, options = {}, expected = {}) { |
| 9 | const { code, signal, stderr, stdout } = await spawnPromisified(execPath, args, options); |
| 10 | |
| 11 | if (expected.stderr) { |
| 12 | assert.match(stderr, expected.stderr); |
| 13 | } |
| 14 | |
| 15 | if (expected.stdout) { |
| 16 | assert.match(stdout, expected.stdout); |
| 17 | } |
| 18 | |
| 19 | assert.strictEqual(code, expected.code ?? 0); |
| 20 | assert.strictEqual(signal, expected.signal ?? null); |
| 21 | } |
| 22 | |
| 23 | // Common expectation for experimental feature warning in stderr |
| 24 | const experimentalFeatureWarning = { stderr: /--entry-url is an experimental feature/ }; |
no test coverage detected
searching dependent graphs…