Reputation: 78850
I have forked a NodeJS project that uses the Test Anything Protocol (node-tap). I am using the WebStorm 8.0.1 IDE. I would now like to do step debugging when running the unit tests. Since tap seems pretty obscure in the world of Node, of course there's no run/debug configuration for that framework built into WebStorm.
I was able to run the tests through the IDE by configuring a Node.js run configuration with these settings:
Node interpreter: C:\Program Files\nodejs\node.exe Node parameters: --debug-brk Working directory: {my project directory} JavaScript file: node_modules\tap\bin\tap.js Application parameters: test/test-*.js
However, when debugging with this configuration, my breakpoints are not hit. Additionally, even inserting a debugger;
statement does not trigger a break.
Is there a way for me to specifically run tap tests in WebStorm? If not, why do you suppose the breakpoints in my tests are not being hit?
Upvotes: 2
Views: 592
Reputation: 78850
In digging through the tap
module, it appears that all it does is launch each test file in a child process that runs node; it then just consumes its output which conforms to the Test Anywhere Protocol.
So for me to debug, I can just debug running my test JS directly with Node. This seems to work fine. Hopefully this will help anyone else unfamiliar with this test framework.
Upvotes: 3