Skip to content

Commit

Permalink
Add recipe on debugging with VSCode (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeer264 authored and novemberborn committed May 6, 2017
1 parent 2b9f291 commit 1d04153
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
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

0 comments on commit 1d04153

Please sign in to comment.