Search code examples
node.jsunit-testingdebuggingwebstormava

WebStorm doesn't stop at breakpoint when debugging ava tests


I have created an npm configuration to debug my ava tests in WebStorm (version 2017.2) following this ava recipe here. When I hit the debug button all tests are being ran but it doesn't seem to stop at any of the breakpoints. I also see bunch of these:

[?25l 
 ⠋ [?25l 
 ⠙ [?25l 
 ⠹  
 ⠸ [?25l[?25l 
 ⠼ [?25l 
 ⠴ [?25l 

This is my npm debug configuration: enter image description here

And this is the ava configuration in package.json:

 "scripts": {
    "start": "nodemon app.js",
    "test": "ava",
  },
  "ava": {
    "files": [
      "test/lib/**/*.js"
    ],
    "source": [
      "app.js",
      "lib/**/*.js"
    ]
  },

Any ideas how to make this work?


Solution

  • Ok, I got it. What recipe doesn't say is, you still need to enable the inspector agent of Node.js by passing --inspect-brk. I put it there and now debugger stops at breakpoints and I can debug as usual.