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
[test runner] Restore TEST_GREP
support (jest's -t
parameter)
#14170
Conversation
9068baf
to
6ef6d68
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/50787/ |
6ef6d68
to
2c99f5f
Compare
Nice! Thanks @nicolo-ribaudo |
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.
Another feature request for jest-light-runner: run in main thread when --runInBand
is provided, mostly used for debugging.
Do you still wish you had |
|
Oh ok, right. I didn't think about it because I take a different approach: using vscode (I don't remember which editor you use), I put a breakpoint in the test file (it works well because they are not compiled, but they are executed natively), and then I run that file with this {
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Test current file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${relativeFile}"]
},
{
"type": "pwa-node",
"request": "launch",
"name": "Test current file (Babel 8)",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${relativeFile}"],
"env": { "BABEL_8_BREAKING": "true" }
}
]
} |
Tested manually running
yarn jest babel-parser/test/index -t placeholders
andTEST_GREP=placeholders TEST_ONLY=babel-parser make test-only
.The logic is copied from https://github.com/facebook/jest/blob/3a85065fe5604655e1337ffc1631f9999722c821/packages/jest-circus/src/run.ts#L105 and https://github.com/facebook/jest/blob/e0b33b74b5afd738edc183858b5c34053cfc26dd/packages/jest-circus/src/eventHandler.ts#L237.
Thanks @pzuraq and @tolmasky for noticing that this stopped working! 😅