majestic
majestic copied to clipboard
Question: Is There A Way to Update All Snapshots Within A Project?
Hello! Not an issue per say, but a question. I just pulled down the project and i noticed there was a button to update the snapshot of an individual file. I was wondering if there was a way to update all snapshots from within the project? I know jest has a cmd to update all snaps, but I think it would be dope if Majestic had an update all button or something, if it doesnt already.
I love the software and its brillant! Great work!
We should add this as a feature. Currently, there is no way to update all snapshots.
Thank you!
For now you can add the -u flag to the majestic config in your package.json.
Hey, I would like to have a go a this feature :)
Do you have a general idea as to where the button should be? At first I thought top of the side bar but I don't think it's a good idea to have that button be very "attractive" to click because a less experienced Jest user could update them all without really knowing what that means. So maybe a bit less visible would be best.
Maybe next to the little "Refresh" button on the side bar? Also possibly raising a "confirm" dialog or something of that nature...
Thank you for taking this up.
If we show a confirmation dialog, then I'm comfortable having it next to the 'Run All' button with a descriptive tooltip like "Updates all the snapshots".
Also to show this button, we need to know if any are any snapshot failures so far. We could inspect the test results as they arrive and set a variable to indicate if there are snapshot failures and then pass the variable via the Summary so the UI would know when to show the button.
if you run into issues or blockers, feel free to ping here so I could help out.
Would this make sense as a toggle next to both the Run tests and Run buttons, so you can toggle whether snapshots should be updated when running all tests or just a single file?