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

Function parent

test/parallel/test-process-raw-debug.js:37–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35}
36
37function parent() {
38 const spawn = require('child_process').spawn;
39 const child = spawn(process.execPath, [__filename, 'child']);
40
41 let output = '';
42
43 child.stderr.on('data', function(c) {
44 output += c;
45 });
46
47 child.stderr.setEncoding('utf8');
48
49 child.stderr.on('end', common.mustCall(() => {
50 assert.strictEqual(output, `I can still debug!${os.EOL}`);
51 console.log('ok - got expected message');
52 }));
53
54 child.on('exit', common.mustCall(function(c) {
55 assert(!c);
56 console.log('ok - child exited nicely');
57 }));
58}
59
60function child() {
61 // Even when all hope is lost...

Callers 1

Calls 6

spawnFunction · 0.70
requireFunction · 0.50
assertFunction · 0.50
onMethod · 0.45
setEncodingMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…