Last active
January 9, 2025 16:43
-
-
Save esamattis/600d6964f3e6ab6e8e7da9a05bfe6574 to your computer and use it in GitHub Desktop.
Debug jest tests in vscode with pnpm
This file contains hidden or 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Jest Current File", | |
"runtimeExecutable": "sh", // <-- The important bit! | |
"program": "node_modules/.bin/jest", | |
"args": ["${relativeFile}"], | |
"console": "integratedTerminal", | |
"internalConsoleOptions": "openOnFirstSessionStart" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Such configuration was not exactly working for me, but I figured out this, and it worked for me. I'm using Jest with ESM modules, pnpm, and Orta's extension (
Orta.vscode-jest
):Of course, args are arbitrary and refer to the configuration I use. But this let me also debug the single tests.
BTW, I also have this in my
settings.json
to let it run: