[Enter] key in watch mode has unexpected behavior #6092
Closed
nathanmmiller
started this conversation in
Feedback
Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Is there a way to override the mappings? I'm running into this a lot because I tend to use tmux to scroll the test output, and then I modify the code, then I come back to the tests and hit enter to bail from scroll mode. What happens is occasionally my tmux isn't scrolled and it clears my filters and runs all tests (on a big repo). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In both jest and vitest, when running watch mode, you can specify a filter to run on via 'p' or 't'. For example, you may have run watch mode on all tests but decide you want only to rerun foo.test.js for a while, so you'd type 'p' and then type 'foo' and [enter] and go from there. On every subsequent rerun, it should run only foo.test.js until you leave that filter.
In jest, this works as expected - a rerun caused by HMR or by the [enter] key will run only foo.test.js.
In vitest, this only half works as expected - a rerun caused by HMR will run only foo.test.js. However, a rerun caused by the [enter] key will rerun all tests. Oddly, this does not clear the filter. Once all tests are done, HMR will again rerun only foo.test.js.
I believe this is a bug - I believe that [enter] in a watch mode terminal should respect any current filters.
Beta Was this translation helpful? Give feedback.
All reactions