Skip to content
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

Merged
merged 2 commits into from
Sep 10, 2016
Merged

Conversation

skevy
Copy link
Contributor

@skevy skevy commented Sep 10, 2016

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

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
@ghost ghost added the CLA Signed ✔️ label Sep 10, 2016
@cpojer cpojer merged commit 9b6304a into jestjs:master Sep 10, 2016
@cpojer
Copy link
Member

cpojer commented Sep 10, 2016

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]`
Copy link

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?

Copy link

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.

Copy link

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]

Copy link

@Kerumen Kerumen Sep 10, 2016

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.

Copy link
Contributor

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

Copy link
Member

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.

Copy link

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/

Copy link
Contributor

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

tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* 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
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants