Closed PizzaPartyInc closed 2 years ago
hey @PizzaPartyInc
i don't this i can change the --inspect-brk flag i think it will be added by vscode
here is the corresponding source code, where we create the debug config.
If you know how to improve it, pull-requests and suggestions are always welcome ;)
Hey! Thanks for the reply! Unfortunately, I don't see myself having free time in the near future to explore how vscode extensions are made and work, my knowledge is close to zero here...
The inspect flag is a QoL improvement, and for additional prefix for debugging, I'm currently loading configs 2 times from the code as a workaround. It's not pretty, but it works....
So, pull requests would have to wait. As for suggestions - the straightforward way would be to add a separate config value, e.g. jestRunner.debugCommand
and have a value like yarn util:load-vars 'C:\Program Files\nodejs\node.exe' '--inspect' 'node_modules\jest\bin\jest.js'
for it but the way it looks it would not be realistic to implement since a lot of debugging script generation logic is happening in vscode components. I would check vscode.DebugConfiguration
to see if there is some fitting option that can help there, but I can't quickly find the source code for that type, so hard to tell.
Hey!
I've been having hard time debugging tests recently (v0.4.34) and noticed 2 places where the experience can be improved:
What changed this behavior is manualy changing
'--inspect-brk=33027'
to'--inspect=33027'
. Then re-launchin script successfully attaches the debugger. (but I would not do this every time)Question/Suggestion - is there a way to configure the inspect flag? And if not - is it possible to implement such configuration?
jestrunner.jestCommand
, but it's only applicable when usingRun
, and not when usingDebug
. In my case, the value is something likeyarn util:load-vars jest
. In the context of monorepo, we separate configuration in root configuration and service configuration andutil:load-vars
loads all environment variables. Since some of the tests use those variables, we basically need to prefix all scripts that need variables withyarn util:load-vars
. Is there some option that would allow doing so forDebug
option, and not justRun
? And if not - is it possible to implement? :)For example, I was currently able to debug by manually changing a debug script from this:
to this:
Thanks! :)