-
Notifications
You must be signed in to change notification settings - Fork 295
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
[Feature request] Add ability to force rerun of all tests #176
Comments
Sounds good, you're welcome to add a command that does this 👍 |
We might be able to interact with Jest in watch mode. |
It would be nice to interact with Jest directly and keep in the watch mode without restarting the Jest process. If I understand it correctly it would require to change |
Interacting with Jest in watch mode was what I was thinking, too. Seems we need a custom runner to achieve this, since jest-editor-support does not support it as far as I can tell. I have been fiddling with the idea a little bit, but I'm having issues with the Jest child process not accepting input on stdin from another node process. Could this be because the stream used to write commands doesn't look like a terminal to Jest? Perhaps it is possible with some sort of terminal emulation in between? |
Yep. Have a look at jestjs/jest#5017 from a week ago for the cause of the problems and a proposed workaround.
It doesn't support interacting with watch mode yet. With the stdin challenge probably resolved (but not tested yet), we can dream up the API. So far, I was thinking the API ...
The "Watch Plugin" handlers ...
|
The workaround proposed by @seanpoulter seems to at least make the jest process accept raw input 👍, so we can probably make it work with that. I can probably have a proposal for a custom runner prototype ready for critique (at least for the basic features like capturing output and rerunning tests) ready sometime late next week. Given we agree on a custom runner being the right approach at least until jest-editor-support gets more flexible (?) |
Based on what I've seen about In other news, @orta's helped me reach out to another dev who's also working on an API to interact with Jest -- I'll keep you posted and/or hopefully they jump in on the thread. 🤞 |
@seanpoulter, @connectdotz in #189, I also hoped to create new abstractions to communicate with Jest process, so if there is yet someone else working on Jest API, do you suggest that I stop for a moment? |
Sorry for the ambiguity. I said "working on an API to interact with Jest" which doesn't say it was specific to What I'm encouraging is that we consider |
Ok, clear. I will then do some work over the weekend. |
Here's an update from @Raathigesh on his efforts to interact with Jest:
|
these issues share a clear common need: restart jest. There are a few approaches to solve this:
I don't know if there are other issues need the additional features provided by the more complex solutions; but if our goal is to provide |
Could we have a simple command like:
Here: I will appreciate it and I think that more people also, I need to stop a start your (very useful) extension 2 or 3 times a day, a rerun command would be more than welcome. Thanks! |
@ymulenll we should indeed get back to it as this issue is pretty old ;). Unless someone has time to search for a more direct integration with Jest, I think this is something we could consider, but then done slightly differently. We already do have functionality to restart the process - when snapshots get updated. So the correct way to restart the JestProcess is by doing: this.jestProcessManager.stopJestProcess(this.jestProcess).then(() => {
this.startProcess()
}) Then we can provide a command to do just this and we are almost done. What are your views on it? Cheers! |
Hello @marcinczenko, thanks for your answer, In my case I use the console to update snapshots instead of using always the vscode-jest button, and in those cases the extension does not rerun so I need to stop and start it in order to make it work (and also if I use the extension button to update snapshot it does not rerun the affected tests). There are other cases when I do a git pull from other partners' work to my branch, and the extension does not rerun neither. And other cases that happen to my team and me that I do not remember all. A simple rerun command would be appreciated for some cases in which we want to run again all the test cases. (I need to restart the (very useful) extension 2 or 3 times a day). Thanks! |
I will create a pull request soon. Then other maintainers can comment on it. Or maybe you @ymulenll would like to create pull request? If you like, you are more than welcomed! |
Would be nice to have a feature (a command for instance) to rerun all tests without stopping and restarting the extension.
The text was updated successfully, but these errors were encountered: