-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 Command Hooks to Custom Runners #5212
Comments
Interesting, we should definitely support this workflow. I think your idea about making it so that runners can extend the watch mode with extra commands (using the watch mode plugin API) is great, we should go for that, and also move The only things that worry me here is that I’m unsure how we could also support this from the command line using the same API. Do you have any ideas for this? |
I'm thinking it would work exactly the same as snapshot updates. If the right CLI flag is specified, and a test result returns an actionable command, then that command is immediately executed. So the following two commands would be the same:
One could run Maybe we'd need an API to re-run that test post the command being executed, or to dismiss the failed status of a test? |
Yeah, I think that works for me, even though the flag is quite long. I’m fine with |
Could always add an alias like |
Yeah this approach sounds good to me. |
I think this is mostly closed off by #5212 🎉 |
Links to 5212 :p What did you intend to link to? |
Oops, #5399. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Feature.
When running Jest with
jest-runner-eslint
in watch mode, I'm often presented with this:Note that the plugin (via the ESLint default formatter) suggests passing
--fix
to correct this error. This is true if you are using the ESLint CLI, but as this workflow integrates deeply with Jest, you either need to:(e.g.
jest -c jest.eslint-fix.config.js
)eslint . --fix
separately. (Which may require re-stating CLI flags such as--ignore-path
)Neither of these workflows are particularly nice.
There are two possible solutions that I can think of:
-u
key to update the file instead of the snapshot.A quick sketch of what the latter might look like follows:
Runner API Sketch
CLI Usage
--watch
UsageThoughts on this workflow?
The text was updated successfully, but these errors were encountered: