Fix test debugging instructions for contributors#14486
Fix test debugging instructions for contributors#14486nicolo-ribaudo merged 1 commit intobabel:mainfrom
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.
I use jest-light-runner when debugging without problems 🤔 Why do we need to disable it?
There was a problem hiding this comment.
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.
What OS and node version are you using?
There was a problem hiding this comment.
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.
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.
Nah, I'll just implement same-thread support in the light runner.
There was a problem hiding this comment.
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.
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.
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.