Skip to content

Commit

Permalink
docs: debugging in VSCode setup (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGinnivan committed Jan 9, 2022
1 parent 6e7c631 commit 125eeab
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export default defineConfig({
text: 'Mocking Requests',
link: '/guide/mocking-requests'
},
{
text: 'Debugging',
link: '/guide/debugging'
},
/* TODO
{
text: 'Using Plugins',
Expand Down
29 changes: 29 additions & 0 deletions docs/guide/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Debugging

## VSCode

To debug a test file in VSCode, create the following launch configuration.

```
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true,
"console": "integratedTerminal"
}
]
}
```

Then in the debug tab ensure 'Debug Current Test File' is selected, you can then open the test file you want to debug and press F5 to start debugging.

0 comments on commit 125eeab

Please sign in to comment.