-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Debugger doesn't hit breakpoints when running Jest tests #59056
Comments
I don't see the files with breakpoints being loaded. What's your launch config like? Have you seen the docs? |
I have read the docs, but the tests are running as expected, so I'm not sure what "loaded" means here. I think the launch config is in the trace, but here it is, including commented options that I tried changing to no avail.
I'm passing "test" to our test-runner, which then runs Jest. |
I meant to paste the link to the Jest docs for vscode in my last comment, and left it out by mistake. https://jestjs.io/docs/en/troubleshooting#debugging-in-vs-code They recommend using |
Thanks, I had seen those docs and had tried "--runInBand". Attached is the trace of trying that again just now, which unfortunately didn't make a difference (I can see that the test files are being run one-by-one, so it has an effect, but the breakpoints still aren't hit.) |
I don't see runInBand being used in that log
|
Yeah, it’s passed in by our test runner. I wonder if that test runner is the problem. Breakpoints in that do get hit. |
Oh, so you're debugging something that then spawns jest? In that case, the debugger is not attached to the process actually running the tests. |
Yes, that’s correct. |
Don't know if this is related, but it's driving me crazy. I'll set breakpoints in my test file and when I launch the debugger, the breakpoints will change. Its been happening to me all week. I'm new to working with the VSCode debugger. I thought it was something I was doing. But maybe it's something else. The above happens with and without the Jest extensions enabled. I thought it might be the extension, so I turned it off. It's still occurring. I've had a couple different configurations, but this is the most current, which is taken from Jest website: |
@Contrapuntist please open a new issue. A repo where I can see the issue would be great. @rswerve I don't know what your setup is exactly, but you'll have to change it somehow such that the jest process is the thing that's started in debug mode. If you can change it to pass |
I’ll try that. Thanks. |
@roblourens @rswerve did this get resolved? I'm having the same problem. |
Issue Type: Bug
Trace attached.
debugadapter.txt
Steps to Reproduce:
The breakpoints say "breakpoint set but not yet bound" and remained grayed out for the duration of the tests.
I'd expect the breakpoints to be hit. Console.log in the files with breakpoints do work and the tests run properly. This persists when all extensions are disabled.
VS Code version: Code 1.27.2 (f46c4c4, 2018-09-12T07:04:11.329Z)
OS version: Darwin x64 16.7.0
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Extensions (15)
(7 theme extensions excluded)
The text was updated successfully, but these errors were encountered: