Uh oh!
There was an error while loading. Please reload this page.
feature/add-first-class-debugging-support-for-tests - #1360
Conversation
facebook-github-bot
commented
Jan 7, 2017
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
There was a problem hiding this comment.
note, running node --debug-brk ./node_modules/.bin/react-scripts test --debug-brk will biff on conflicting port access to 5858, if this wasn't clear already. I did not handle this case, but it may be worth discussion?
There was a problem hiding this comment.
🎉 greet the debugging user with some 🌶 🔥 tips
facebook-github-bot
commented
Jan 7, 2017
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this comment.
any of the node debug flags are not valid input to jest. something counter convention i did in this PR was allow a debug flag (like --debug-brk) to enter via argv, where previously all of the other args were jest specific. IMHO, this is OK. the filtering may be cleaner towards the top-of-the-file
cdaringe
commented
Jan 7, 2017
i'm a little puzzled w/ the CI error. it fails on being unable to locate a file, but only on some node versions. maybe a caching thing? can someone weigh in or re- kick it off? |
@cdaringe CI fails becasue this require at utils dir is not available after |
There was a problem hiding this comment.
For this to work after the eject, you'll probably have to add the right path here.
c976b56 to
14d53fbComparethanks @tuchk4, @EnoahNetzach. i dropped the editor ignore commit, rebased w/ patches to restore the build. should be g2g now, post review :) |
cdaringe
commented
Jan 9, 2017
FYI, to reviewers, this also only accepts one flag as written. that is |
gaearon
commented
Feb 12, 2017
Tagging with a milestone because we need to review this. |
cdaringe
commented
Feb 12, 2017
i'm not entirely in love with the implementation, especially now that |
Gregoor
commented
Mar 23, 2017
Would love to see this land or help in making it happen. Especially as Webstorm/IntelliJ integrated testing would then work with create-react-app (related issue). |
I won't have time to review this until first week of April. |
lifeiscontent
commented
Apr 10, 2017
@Timer any updates on this? |
Timer
commented
Apr 10, 2017
Just added it to my list of soonish TODOs, @lifeiscontent. Thanks for the reminder. ❤️ |
lifeiscontent
commented
Apr 10, 2017
@Timer you rock! 👍 |
Considering that the legacy protocol is dead, I'm not sure if we should implement it ( On that note, I'd like to see support for strictly Also, we should make sure it supports the port syntax @cdaringe do you happen to have any free time to bring this PR up to date? |
cdaringe
commented
Apr 10, 2017
totally. in agreement.
yep. agreed.
if you can find a way around it, that'd be great! i'm swamped for a few weeks--i wont be getting to it anytime soon. :( |
quantuminformation
commented
Apr 12, 2017
So looking fwd to this, it will also enable Jetbrains to debug JSX: |
Timer
commented
Apr 12, 2017
@cdaringe not a problem, thanks so much for letting me know! |
| babelrc: false | ||
| }); | ||
| const babelJestDebugConfig = require('./babelJestDebugConfig'); | ||
| module.exports = babelJest.createTransformer(babelJestDebugConfig); |
There was a problem hiding this comment.
this was probably supposed to be Default v Debug?
| const babelTransform = isEjecting | ||
| ? '<rootDir>/node_modules/babel-jest' | ||
| : resolve('config/jest/babelTransform' + (isDebug ? 'Debug' : '') + '.js') |
There was a problem hiding this comment.
@Timer, 👀, this is where/why there were two babelTransform files. we are passing the babel config as a file path, therefore, to enable sourceMaps, i added a different file. if there's another way to get those babel settings passed to jest, we could pursue that. we could also set something in the ENV to drop it down to one transform file?
There was a problem hiding this comment.
Ok I hadn't reviewed deep enough to have this understanding.
Thanks for explaining!
I'll snoop around and see what our best option(s) are. 😄
thg303
commented
Apr 20, 2017
would somebody pleeaaase merge this! I am pulling my hairs on debugging for a week now :'( |
quantuminformation
commented
Apr 20, 2017
@thg303 you should have some hairs left before webstorms 2017.2 release |
Timer
commented
Apr 20, 2017
Sorry for the delay @thg303. |
cdaringe
commented
Apr 28, 2017
moving to #2041 |
avantgardnerio
commented
Aug 7, 2017
The solution does not work for me, I can't figure out how to debug jest. |
cdaringe
commented
Aug 7, 2017
It's super old on the react-scripts time scale, I wouldn't expect it to |
avantgardnerio
commented
Aug 8, 2017
For those who are also stuck, it looks like you can downgrade to node 7.10 to debug: |
problem statement
react-scriptsdoes not offer ready-to-roll jest debugging.solution
--debug-brkanddebugare working flags passed tonpm test. that isnpm test -- --debug-brkworks. i think this is a nice entry point into the system.closes#594