Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/recipes/debugging-with-vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Debugging tests with Visual Studio Code

## Setup

In the sidebar click the `Debug` handle.

Add a new configuration in the dropdown menu next to the green `Debug` button: `Add configuration`. This will open `launch.json` with all debug configurations.

Add following to the `configurations` object:

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

Save this configuration after you added it.

## Debug

> **Note:** The file you want to debug, must be open and active

Set breakpoints in the code.

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.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ $ node --inspect node_modules/ava/profile.js some/test/file.js

- [Chrome DevTools](docs/recipes/debugging-with-chrome-devtools.md)
- [WebStorm](docs/recipes/debugging-with-webstorm.md)
- [Visual Studio Code](docs/recipes/debugging-with-vscode.md)


## Reporters
Expand Down