Skip to content

Commit

Permalink
Debug serially in the "Debugging tests with VS Code" recipe (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
troysandal authored and sindresorhus committed Jan 17, 2018
1 parent aaddc37 commit 4a13966
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/recipes/debugging-with-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,22 @@ Save this configuration after you added it.
Set breakpoints in the code **or** write `debugger;` at the point where it should stop.

Hit the green `Debug` button next to the list of configurations on the top left in the `Debug` view. Once the breakpoint is hit, you can evaluate variables and step through the code.

## Serial debugging

By default AVA runs tests concurrently. This may complicate debugging. Add a configuration with the `--serial` argument so AVA runs only one test at a time:

```json
{
"type": "node",
"request": "launch",
"name": "Run AVA test serially",
"program": "${workspaceRoot}/node_modules/ava/profile.js",
"args": [
"--serial",
"${file}"
]
}
```

*Note that, if your tests aren't properly isolated, certain test failures may not appear when running the tests serially.*

0 comments on commit 4a13966

Please sign in to comment.