My application calls child_process.fork during execution. I would like to use --inspect-brk to debug the tests, but I do not care about the forked process. I actually specifically need the forked process to not inherit the --inspect-brk flag. How can I do that?
From the child process docs, for child_process.fork:
execArgv List of string arguments passed to the executable. Default: process.execArgv
So, the forked process inherits the main process arguments passed. With that in mind, you should override execArgv:
var cp = require('child_process');
var foo = cp.fork('./foo.js', { execArgv: [] });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With