From 01ec2804ab9db0ab3ef11e3b5b0c5697d68f8bc5 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Sun, 31 Mar 2024 14:49:15 -0400 Subject: [PATCH] Add VS Code debugging instructions for Yarn PnP projects --- docs/recipes/debugging-with-vscode.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index 02355ff25..854b0b1bd 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -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": [ + "/**/*.js" + ] +} +``` + ## Serial debugging By default AVA runs tests concurrently. This may complicate debugging. Instead make sure AVA runs only one test at a time.