Step debug during a test run. Add the statement:to where you want to break in the code, and then run:where
debugger;
npm run testi -- -g 'p with id before'
i
in testi
stands for inspect
from node inspect
. Also consider the alias:npmtgi() ( npm run testi -- -g "$*" )
Note however that this does not work for tests that run the but not working, related: stackoverflow.com/questions/23612087/gulp-target-to-debug-mocha-tests So for now, we are just printing the command being run as in:so you can just re-run it manually with This works since the
ourbigbook
executable itself, since those spawn a separate process. TODO how to do it? Tried along:const out = child_process.spawnSync('node', ['inspect', 'ourbigbook'].concat(options.args), {
cwd: tmpdir,
input: options.stdin,
stdio: 'inherit',
});
cmd: cd _out/test/executable-ourbigbook.json-outputOutOfTree && ourbigbook --split-headers .
node inspect
as in:cd _out/test/executable-ourbigbook.json-outputoutoftree && node inspect "../../../ourbigbook" --split-headers .
tmp
directory is not deleted in case of failure.