Skip to content
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

feat(whitelist-snapshots): option for whitelisting snapshots #288

Merged
merged 15 commits into from Jul 16, 2019

Conversation

benmonro
Copy link
Contributor

This pull request adds an option to whitelist snapshots. Since .snap files are generated, if you try to use //eslint-disable-next-line in a .snap file, the next time any snapshot is updated in that file, all of those comments will be removed. For codebases with a large number of large snapshots, it is useful to be able to grandfather in existing large snapshots, while at the same time not allowing new large snapshots into the code.

@benmonro
Copy link
Contributor Author

@jeysal @SimenB This option is much simpler than trying to associate the .snap back to the test. Thoughts? :)

@benmonro
Copy link
Contributor Author

benmonro commented Jul 3, 2019

Can someone merge this? Or at least give feedback?

src/rules/no-large-snapshots.js Outdated Show resolved Hide resolved
src/rules/no-large-snapshots.js Outdated Show resolved Hide resolved
src/rules/no-large-snapshots.js Show resolved Hide resolved
@SimenB
Copy link
Member

SimenB commented Jul 4, 2019

Following #291, also please update the schema for this rule to include the option 🙂

@benmonro
Copy link
Contributor Author

benmonro commented Jul 8, 2019

@SimenB @jeysal I have addressed all of the requests in the review, can we merge this now? really want to try and stop the hemorrhaging of large snapshots on our team. :)

@jeysal
Copy link
Member

jeysal commented Jul 8, 2019

@benmonro looks like you have some leftover code ("jestx") in there, might want to remove that so it's ready when Simen has time for a final review and merge :)

@benmonro benmonro force-pushed the feature/white-list-snapshots branch from b3a3b63 to 3a8934d Compare July 9, 2019 01:04
@benmonro
Copy link
Contributor Author

benmonro commented Jul 9, 2019

@jeysal thanks, good catch, merged a branch i didn't mean to. fixed.

@benmonro
Copy link
Contributor Author

benmonro commented Jul 9, 2019

Help me @SimenB you're my only hope!
image

@benmonro
Copy link
Contributor Author

@SimenB I noticed some merges that went in, but this PR got skipped. is there something I'm missing that you'd like to see included here? We really could use this feature. please advise.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for being patient with me! 😅

docs/rules/no-large-snapshots.md Show resolved Hide resolved
@benmonro
Copy link
Contributor Author

@SimenB @jeysal ok guys, I have addressed everything, including Simen's latest comments. Now that Simen approved, can we please please please please merge this? I've been very patient. In the meantime my team is writing large snapshots and we need this desperately. please merge. pretty please... with cherries on top. 😄

@SimenB SimenB merged commit 25e3970 into jest-community:master Jul 16, 2019
@benmonro
Copy link
Contributor Author

Thanks @SimenB !

@SimenB
Copy link
Member

SimenB commented Jul 16, 2019

🎉 This PR is included in version 22.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants