(killSignal, beforeSpawn)
| 12 | const { SIGKILL } = require('os').constants.signals; |
| 13 | |
| 14 | function spawn(killSignal, beforeSpawn) { |
| 15 | if (beforeSpawn) { |
| 16 | internalCp.spawnSync = common.mustCall(function(opts) { |
| 17 | beforeSpawn(opts); |
| 18 | return oldSpawnSync(opts); |
| 19 | }); |
| 20 | } |
| 21 | const child = cp.spawnSync(process.execPath, |
| 22 | [__filename, 'child'], |
| 23 | { killSignal, timeout: 100 }); |
| 24 | if (beforeSpawn) |
| 25 | internalCp.spawnSync = oldSpawnSync; |
| 26 | assert.strictEqual(child.status, null); |
| 27 | assert.strictEqual(child.error.code, 'ETIMEDOUT'); |
| 28 | return child; |
| 29 | } |
| 30 | |
| 31 | // Verify that an error is thrown for unknown signals. |
| 32 | assert.throws(() => { |
no outgoing calls
searching dependent graphs…