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
[new rule] no-snapshots #312
Comments
For sure, I bet more people would like to use it. Thanks! |
this is already supported by just setting the maxSize to zero on no-large-snapshots |
What about a parameter that would still allow snapshots as long as other non-snapshot assertions are present? I'm not completely against snapshots as a guide to how stuff should look overall but I am against them if there are no assertions for actual elements. |
🎉 This issue has been resolved in version 23.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@benmonro I was hoping for that, but it's not true. Here are the problems:
I believe the For reference, the URL to docs linked by @cartogram above is broken, it should be this: https://github.com/Shopify/web-configs/blob/main/packages/eslint-plugin/docs/rules/jest/no-snapshots.md
|
@markogresak it was actually me who closed the issue, via implementing |
Thanks for a quick answer, on a Sunday no less! I have completely missed that part since I was focused on disallowing snapshot matching. For anyone else looking for this, here's how to set it up to work exactly like the
|
Bless you for banning snapshot tests. Are they even tests at all? |
I would say not really 😄 I see it as an lazy alternative to explicitly matching for the expected properties. The latter takes a bit more time, but it's easier for future devs to read and understand the assertions. |
I found them to even be counter productive. Make a small change and break 50 unrelated snapshot tests. Then you either -u or waste time chasing ghosts |
Wondering if I could contribute this
no-snapshots
rule that I wrote for ShopifyThe text was updated successfully, but these errors were encountered: