Skip to content

Commit 1d04153

Browse files
JPeer264novemberborn
authored andcommitted
Add recipe on debugging with VSCode (#1375)
1 parent 2b9f291 commit 1d04153

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/recipes/debugging-with-vscode.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Debugging tests with Visual Studio Code
2+
3+
## Setup
4+
5+
In the sidebar click the `Debug` handle.
6+
7+
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.
8+
9+
Add following to the `configurations` object:
10+
11+
```json
12+
{
13+
"type": "node",
14+
"request": "launch",
15+
"name": "Run AVA test",
16+
"program": "${workspaceRoot}/node_modules/ava/profile.js",
17+
"args": [
18+
"${file}"
19+
]
20+
}
21+
```
22+
23+
Save this configuration after you added it.
24+
25+
## Debug
26+
27+
> **Note:** The file you want to debug, must be open and active
28+
29+
Set breakpoints in the code.
30+
31+
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.

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ $ node --inspect node_modules/ava/profile.js some/test/file.js
203203

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

207208

208209
## Reporters

0 commit comments

Comments
 (0)