-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add information about how to use Node debugger #1663
Conversation
This adds information in the troubleshooting section about how to use the Chrome inspector in Node versions greater than or equal to 6.3 to debug Jest tests. Relevant to this tweet: https://twitter.com/cpojer/status/774440000553226240
you are the best! I shall invite you to a nice dinner and/or beer. |
|
||
Place a `debugger;` statement in any of your tests, and then, in your project's directory, run: | ||
|
||
`node --debug-brk --inspect ./node_modules/.bin/jest --i [any other arguments here]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be -i
instead of --i
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kerumen could you get this to work? I tried with node 6.5, it never stops at my debugger;
line :-( I tried -i
as well. thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the help says -i
is correct
--runInBand, -i Run all tests serially in the current process
(rather than creating a worker pool of child
processes that run tests). This is sometimes
useful for debugging, but such use cases are
pretty rare. [boolean]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, same here. I just read the PR and found this --i
weird. But indeed after testing, it also never stops at my debugger;
line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem listed here #1652
It will work if you use node debug --debug-brk ./node_modules/.bin/jest -i
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, it was late last night and I was exhausted so I made a typo when I fixed up another typo by @skevy :D Fixed it now. -i
is the right command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maximderbin does it allow chrome debugger to connect with node debug
. Which url should I use? tried http://127.0.0.1:5858/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's only nodejs repl...without inspector
* Add information about how to use Node debugger This adds information in the troubleshooting section about how to use the Chrome inspector in Node versions greater than or equal to 6.3 to debug Jest tests. Relevant to this tweet: https://twitter.com/cpojer/status/774440000553226240 * Update Troubleshooting.md
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This adds information in the troubleshooting section about how to use the Chrome inspector in Node versions greater than or equal to 6.3 to debug Jest tests.
Relevant to this tweet: https://twitter.com/cpojer/status/774440000553226240