Nodeunit debugging in windows

124 Views Asked by At

I am trying to debug tests when running nodeunit and was trying something that is explained in this SO Question but when in try it does not work in Windows.

    d:\code\path>node --debug-brk `which nodeunit` test\tests.js
    Debugger listening on port 5858
    module.js:338
        throw err;
              ^
    Error: Cannot find module 'd:\code\path\`which'
        at Function.Module._resolveFilename (module.js:336:15)
        at Function.Module._load (module.js:278:25)
        at Module.runMain [as _onTimeout] (module.js:501:10)
        at Timer.listOnTimeout (timers.js:110:15)

I am trying this in Windows and node_path is in System variables.

1

There are 1 best solutions below

0
Carlo On

which is a unix command, and `which nodeunit` in backticks means: 'print here the path of the nodeunit command'

Sadly on windows neither wich nor backticks works, so you have to do it by hand.

A similar command is where, so you can run 'where nodeunit', take note of the output and then rune

node  --debug-brk c:\....\nodeunit test\tests.js