-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Consider not updating snapshots automatically #2099
Comments
I am currently writing a modification to a library that uses AVA for the tests and I found the current behavior very confusing before I bumped into the original issue (#1585) comments. There is also no mention about this behavior in the documentation: This change would be highly welcomed for newcomers. This is my first time ever using AVA. |
Given my extensive commenting on #1585, I'd like to argue against this.
Many of the issues raised by @billyjanitsch, while real, belong outside a test runner.
IMHO the pre-commit/push/publish hooks should include a step to check for uncommitted modifications. That's not to deny @billyjanitsch's concern that it complicates things, it does. It'll either require I think @novemberborn's instinct on calling this bike-shedding is exactly right. |
Either way, document how it works so that also people not familiar with AVA will understand how it works. Or at least when they bump into this behavior, they get the information from the documentation that it is how it is designed to work. |
Yea I'm ambivalent on this. If we get the experience right, this may be worthwhile. But equally perhaps the solution is to have improved reporter output. |
The This workflow also solves #2636: since committing snapshots is separate from the test run, it's natural for snapshot assertions to fail on a mismatch, and the user expects to re-run tests after committing snapshots anyway. The test runner then doesn't have to predict whether the snapshots will end up committed or not.
|
@ninevra that sounds great. |
Why not just introduce a flag called, say, |
It may be considered odd that AVA automatically updates snapshots. From @billyjanitsch #1585 (comment):
Then from @novemberborn #1585 (comment):
The text was updated successfully, but these errors were encountered: