Skip to content

Commit 01ec280

Browse files
authored
Add VS Code debugging instructions for Yarn PnP projects
1 parent 5d48c95 commit 01ec280

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/recipes/debugging-with-vscode.md

+20
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ Assuming the names of your test files are unique you could try the following con
6868
}
6969
```
7070

71+
### Using Yarn PnP (Plug'n'Play)
72+
73+
As [Yarn's PnP (Plug'n'Play)](https://yarnpkg.com/features/pnp) installation strategy does not produce a `node_modules` folder, the `ava` binary must be called using `yarn run`:
74+
75+
```json
76+
{
77+
"type": "node",
78+
"request": "launch",
79+
"name": "Debug AVA test file",
80+
"runtimeExecutable": "yarn",
81+
"runtimeArgs": ["run", "ava"],
82+
"args": ["${file}"],
83+
"outputCapture": "std",
84+
"console": "integratedTerminal", // optional
85+
"skipFiles": [
86+
"<node_internals>/**/*.js"
87+
]
88+
}
89+
```
90+
7191
## Serial debugging
7292

7393
By default AVA runs tests concurrently. This may complicate debugging. Instead make sure AVA runs only one test at a time.

0 commit comments

Comments
 (0)