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

Function childShouldThrowAndAbort

test/common/index.js:288–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286// `$node --abort-on-uncaught-exception $file child`
287// the process aborts.
288function childShouldThrowAndAbort() {
289 const escapedArgs = escapePOSIXShell`"${process.argv[0]}" --abort-on-uncaught-exception "${process.argv[1]}" child`;
290 if (!isWindows) {
291 // Do not create core files, as it can take a lot of disk space on
292 // continuous testing and developers' machines
293 escapedArgs[0] = 'ulimit -c 0 && ' + escapedArgs[0];
294 }
295 const { exec } = require('child_process');
296 const child = exec(...escapedArgs);
297 child.on('exit', function onExit(exitCode, signal) {
298 const errMsg = 'Test should have aborted ' +
299 `but instead exited with exit code ${exitCode}` +
300 ` and signal ${signal}`;
301 assert(nodeProcessAborted(exitCode, signal), errMsg);
302 });
303}
304
305const pwdCommand = isWindows ?
306 ['cmd.exe', ['/d', '/c', 'cd']] :

Callers

nothing calls this directly

Calls 6

escapePOSIXShellFunction · 0.85
nodeProcessAbortedFunction · 0.85
requireFunction · 0.50
execFunction · 0.50
assertFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…