Skip to content

Commit

Permalink
Add VS Code debugging instructions for Yarn PnP projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Mar 31, 2024
1 parent 5d48c95 commit 01ec280
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/recipes/debugging-with-vscode.md
Expand Up @@ -68,6 +68,26 @@ Assuming the names of your test files are unique you could try the following con
}
```

### Using Yarn PnP (Plug'n'Play)

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`:

```json
{
"type": "node",
"request": "launch",
"name": "Debug AVA test file",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "ava"],
"args": ["${file}"],
"outputCapture": "std",
"console": "integratedTerminal", // optional
"skipFiles": [
"<node_internals>/**/*.js"
]
}
```

## Serial debugging

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

0 comments on commit 01ec280

Please sign in to comment.