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 yarn debug-test to debug tests in Chrome #11791

Merged
merged 1 commit into from
Dec 7, 2017

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Dec 7, 2017

Works just like yarn test and can also run with a watcher or for a particular file.

yarn debug-test
yarn debug-test IncrementalErrorHandling
yarn debug-test --watch IncrementalErrorHandling

To debug, open chrome://inspect, select the target and then press Play.

screen shot 2017-12-07 at 02 59 17

You can set breakpoints too, both in individual source files and in the test itself.

screen shot 2017-12-07 at 02 56 43

Pretty neat!

Copy link
Contributor

@nhunzaker nhunzaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. Today I learned. I thought this wasn't possible because of an issue with the VM module. Awesome!

@magicmark
Copy link

👍 very cool! QQ - is there any way to get source maps to view the original source code when doing this? Thanks!

@gaearon gaearon merged commit ff3c1b8 into facebook:master Dec 7, 2017
@gaearon
Copy link
Collaborator Author

gaearon commented Dec 7, 2017

Don’t know about the sourcemaps.

@gaearon gaearon deleted the test-brk branch December 7, 2017 11:06
@Kol96
Copy link

Kol96 commented Jun 5, 2019

Don’t know about the sourcemaps.

Is there any way to debug the code with sourcemap in vscode? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants