-
Notifications
You must be signed in to change notification settings - Fork 29.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
Debugging using Mocha and Puppeteer #43754
Comments
What is the result when you run your test from the command prompt:
|
For first point:-
|
In the second case don't use the "debug" since you want to use VS Code (and "--inspect-brk" option is sufficient). |
If I use |
No, just use "mocha --inspect-brk ..." and then attach VS Code. |
@roblourens any idea what is going on here? |
I think that when you launch with If you run from the command line with the exact command that vscode uses minus the Otherwise, since you are using a relative require for Or can you look up call stack to debug |
This does not work from the command line
This also does not work with same error from the command line
These two do work
I will check the CWD and also the relative paths for the requires. As something is amiss |
Intestingly If I use from the command line and attach all works fine and I hit the breakpoints
with the following kaunch.json
However with same setup and hitting F5 in vscode it still bombs out, this is the debug console:-
|
Does it work if you launch it in the integrated terminal? Is the CWD definitely correct in your launch config? Or can you look up call stack to debug test and get some clues as to why it's passing in undefined for browser and opts? |
Firstly thanks for continued support...
When I debug straight from code In all cases L20 is always called first (from command, attach OR from debugging from code) |
Two things you could try:
|
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
I have asked this question also on stack overflow,
My mocha/puppeteer script
My launch.json
When hitting F5 and debugging in VSCode the
browser
andopts
parameters are undefined, as in the image below:-When running from the console everything works ok
I am hoping its a setting in my launch.json that I am missing?
PLEASE NOTE this is not a question about breakpoints NOT being hit in Vscode rather than I am getting different results depending whether I am running in vscode or from a command prompt.
The text was updated successfully, but these errors were encountered: