-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add recipe on debugging with VSCode (#1375)
- Loading branch information
1 parent
2b9f291
commit 1d04153
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters