-
Notifications
You must be signed in to change notification settings - Fork 508
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
VSCode doesn't hit breakpoint (running via node tsdx/dist/index.js test
)
#577
Comments
I haven't tried using the debugger myself, so this still needs more investigation. The error in that issue led me down a rabbit-hole as it appears to be quite common for lots of different use-cases |
Ok tried this out myself on one of my libraries and got it to work without much fuss. My "version": "0.2.0",
"configurations": [{
"name": "Node.js: Debug TSDX Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/tsdx/dist/index.js",
"test",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}] Notably, Idk if this follows best practices but it does work |
node ${workspaceFolder}/node_modules/tsdx/dist/index.js
)
node ${workspaceFolder}/node_modules/tsdx/dist/index.js
)tsdx/dist/index.js
)
tsdx/dist/index.js
)tsdx/dist/index.js test
)
yes! works perfectly. thank you |
Any chance to get this vscode launch script added to readme? I'd be happy to submit a PR if there's support to merge it. Was a life saver when I eventually found it! ❤️ |
@agilgur5 In my case, I was trying to investigate why a test was failing, so I wanted to run it with breakpoints. I tried the default |
@chmac well the root cause issue is really the first one you hit, the missing |
@agilgur5 Thanks for bearing with me with all my questions, I realise you're likely working on this in your spare time, etc, etc. Maybe I'm missing something. I tried reading through #270 to see how testing would work. As I understand that issue, the conclusion (which I support) is to keep jest through As far as I understand what's going on, adding the Again, maybe I'm missing something here. I do see your point that making workarounds more obvious is not a good idea. I understood that this approach was not really a workaround, but more of a "this is the best option unless we add an extra feature". As an alternative, what about adding a "current workarounds" or similar label, then tagging some issues with it, and linking to that somewhere in the readme? I guess my sense is that if you land on this package today, and want to debug your jest tests, the |
With that and #634 , the intent is that you don't necessarily need
This already exists in the pinned HOWTOs issue: #379. |
@agilgur5 Got it, thanks for taking the time to explain it in detail to me, I really appreciate it. The HOWTO pin makes total sense, I missed that one. |
If you're looking at how to get vscode-jest support in your tsdx project, create a file named {
"jest.jestCommandLine": "npm test --"
} I think the jest vscode extension is not working initially because it doesn't detect jest as a direct dependency. I still think the implementation is not perfect because it seems to be slower than a regular setup but it works well. |
Hi, I need a little help here, I am trying to debug jest tests using VScode debugger.
when running the debug mode, the application runs smoothly without hitting and stoping on breakoints.
this is my launch.json
Am I missing somehting?
The text was updated successfully, but these errors were encountered: