-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 test-unit-watch:debug script to package.json #36076
Conversation
@@ -359,6 +359,7 @@ | |||
"test-unit-keep-cljs": "jest --maxWorkers=2", | |||
"test-unit-watch": "yarn test-unit --watch", | |||
"test-unit-watch:cljs": "yarn concurrently -n 'cljs,tests' 'yarn build-watch:cljs' 'yarn test-unit-keep-cljs --watch'", | |||
"test-unit-watch:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --no-cache --watch", |
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 haven't tried it, but I am assuming you can't use just yarn jest
because --inspect-brk
flag is needed to be passed to node?
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.
Have found this though: https://stackoverflow.com/a/48550380
If it works, might be a bit easier to read.
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.
We're on an old version of yarn and the --inspect
flag is not available.
We could use NODE_OPTIONS="--inspect"
but I don't think it's necessarily easier to understand/read than node --inspect-brk path
.
I'd suggest using vscode debugging instead of |
One more IMO: this is a command you'd use in every other project, so alias may be better
I personally used this command only for debugging performance of the tests |
Related Slack discussion. I honestly didn't think this change is going to cause so much stir. |
I needed to debug unit tests today and figured this is a useful little script to have in
package.json
.See https://jestjs.io/docs/troubleshooting.