-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cannot debug tests #1188
Comments
I'm having to use the jest-runner extension to debug tests, it produces the following CLI command which works:
|
It’s possible that the extension is attempting to auto-generate a debug configuration using your After the initial debug attempt, the extension typically outputs the generated debug configuration in the terminal window. You can use that output to create a custom configuration. Based on the information you have provided, your debug configuration might look something like this: {
"type": "node",
"name": "vscode-jest-tests.v2.your-folder",
"request": "launch",
"args": [
"--runInBand",
"--detectOpenHandles",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"cwd": "absolute-path-to-your-folder",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "absolute-path-to-your-folder/node_modules/.bin/jest",
"runtimeArgs": ["--expose-gc"]
} In this configuration:
Let me know if this helps resolve the issue. |
@connectdotz thanks for the response, the config you provided fixes the issue and I'm able to debug via the extension with the node flags applied Is there any plan to allow the node flags to be configured via extension settings to avoid a custom debug config? |
Describe the bug
I am getting a console error when trying to debug tests
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
node -v
: 20.16.0npm -v
: 10.8.2"node --expose-gc 'node_modules/.bin/jest' --runInBand --detectOpenHandles"
{ "coverage": true, "showInlineError": true, "type": "on-demand", "runAllTestsOnStartup": false, "deferred": false }
{ "revealOn": "demand", "revealWithFocus": "none", "clearOnRun": "none" },
"jest.useDashedArgs": true,
"jest.useJest30": false,
Prerequisite
Additional context
Add any other context about the problem here.
Example terminal output:
The fastest (and the most fun) way to resolve the issue is to submit a pull request yourself. If you are interested, please check out the contribution guide, we look forward to seeing your PR...
The text was updated successfully, but these errors were encountered: