-
Notifications
You must be signed in to change notification settings - Fork 970
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
Fix rw test
watch logic
#1415
Fix rw test
watch logic
#1415
Conversation
In my experience 99% of the time I run tests locally I want to watch them, that's how this piece came into existence. This is also the default in CRA: https://create-react-app.dev/docs/running-tests/#command-line-interface I think defaulting |
Just want to chime in here and say that making it watch by default was something that me and @RobertBroersma chatted about, and I think he's right, making it watch by default is usually what I want. I think the question is does |
@peterp I think that worked for a brief moment CRA: https://stackoverflow.com/a/39726625/2211961 |
Ah, what I mean is that on our side if we type |
Really? TIL |
Yes, you can disable a Boolean in Yargs with Just as Jest itself doesn't default to
Lastly, we definitely need to be able to disable watch for CI use cases. |
The majority of time when I'm running tests it's because I'm writing tests and when I'm writing tests this is the expected behaviour. |
For me personally, when I'm in Ruby mode, I have a keyboard shortcut that runs the current test file and another that runs the current test (whichever one the cursor is in) and that's my usual flow when I'm writing tests. The auto-run functionality in Ruby never felt quite ideal. I also find it distracting with all the runs happening which are obviously going to fail as I'm still writing the tests but saving in the meantime. David has a great point that if it's not the default for Jest then maybe it shouldn't be the default here either? The downside to that, which I found since #1414, is that |
I hear you, and Jest in watch mode has this awesome menu:
You can filter by failing, regex, or filename. I actually use wallaby now, and usually just do something like 👍 on the db stuff, I actually stopped using |
^^ @peterp if and when there's time, I'm very interested to see you workflow here
^^ are you using wallaby here as well? If not, curious what you've replaced this with and if we should add to Redwood or improved the Redwood DB tests to be more performant? |
Seems like people who actually use this aren't loving this change—I'm gonna close this for now! |
hahaha Here we go |
@cannikin This PR does two things:
We need to fix the bug. If it is decided that this will be enabled by default, we should then update the description to explain to users how to disable it with CLI Docs should be updated as well. Happy to help with any/all of the above. |
Okay coordinate with @peterp and @RobertBroersma to decide which one, but I'm not comfortable merging as it currently is with them both disliking the behavior this change introduces (disabling watch by default). |
I started using |
@cannikin Just a reminder of our conversation on the zoom call: So we're going to keep this, but we'll flip the And then I guess we need to make sure that we can do I wonder if we need to provide both the watch and watchAll flags here? @RobertBroersma, could we simplify this and just introduce a |
I think that would work. Especially since running with |
rw test
watch logic
Okay folks let me know how this update looks:
|
Looks great! |
The logic that would set the proper watch flag based on what kind of repo this is would ALWAYS run, regardless of whether the user set the--watch
flags or not when runningyarn rw test
. Yargs was defaulting those flags tofalse
so let's respect that choice and only run the watch logic check if the user actually wants to watch!We reversed this decision, see discussion! There was still a bug (you couldn't not start Jest without watching) but in addition we also properly default watch to
true
and user can turn off with--no-watch
./cc @thedavidprice @RobertBroersma @peterp