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
Fix test debugging instructions for contributors #14486
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52442/ |
jest.config.js
Outdated
supportsESMAndJestLightRunner && !isDebug | ||
? "jest-light-runner" |
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 use jest-light-runner
when debugging without problems 🤔 Why do we need to disable it?
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 can't hit any debuggers inside test setup or tests when it's turned on. I don't know why that is.
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.
What OS and node version are you using?
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.
Oh, looking at nodejs/node#26609 it seems like it doesn't work with some debuggers, such as Chrome's (I'm using the VS Code debugger).
You may add a comment that if your debugger does not support worker_threads, you can edit the jest config to use the old runner.
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.
Ah yep, I'm using chrome's. I don't like telling people to change configs. If you're not comfortable with keying this on TEST_DEBUG
maybe it could have its own environment variable like TEST_NO_WORKER_THREADS
which contributing could mention?
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.
Nah, I'll just implement same-thread support in the light runner.
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.
Jest uses same-thread execution when it determines that only one file matches testNamePattern
. Will you use that same heuristic?
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.
No, for simplicity you will always have to specify the --runInBand
option (which is implied by TEST_DEBUG
).
Could you try if nicolo-ribaudo/jest-light-runner#20 works for you? You only have to replace jest-light-runner
's version in package.json
with nicolo-ribaudo/jest-light-runner#run-in-band
.
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.
It works I hit my breakpoint.
60abd38
to
e314ea7
Compare
OK I've updated the PR. It now brings in your new version of |
e314ea7
to
85292ed
Compare
Stop this dang lite runner from breaking all my breakpoints! Tell other developers how to ensure it does not happen to them! This ate my whole afternoon! Ugh.