MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-child-process-exec-error.js:27–34  ·  view source on GitHub ↗
(fn, code, expectPidType = 'number')

Source from the content-addressed store, hash-verified

25const child_process = require('child_process');
26
27function test(fn, code, expectPidType = 'number') {
28 const child = fn('does-not-exist', common.mustCall(function(err) {
29 assert.strictEqual(err.code, code);
30 assert(err.cmd.includes('does-not-exist'));
31 }));
32
33 assert.strictEqual(typeof child.pid, expectPidType);
34}
35
36// With `shell: true`, expect pid (of the shell)
37if (common.isWindows) {

Calls 3

includesMethod · 0.80
fnFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…