-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add snapshot testing FAQs #3425
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3425 +/- ##
==========================================
+ Coverage 64.04% 64.92% +0.87%
==========================================
Files 177 176 -1
Lines 6570 6514 -56
Branches 4 5 +1
==========================================
+ Hits 4208 4229 +21
+ Misses 2361 2283 -78
- Partials 1 2 +1
Continue to review full report at Codecov.
|
docs/SnapshotTesting.md
Outdated
|
||
As you've learned, snapshot testing was built to make it easier to write tests for React and React Native. Check out the [React tutorial](/jest/docs/tutorial-react.html) and the [React Native tutorial](/jest/docs/tutorial-react-native.html) to get started with snapshot testing on your React or React Native application. | ||
Snapshot files must always represent the current state of the modules they are covering. | ||
Therefore, if you are merging two branches and encounter a conflict in the snapshot files, the best solution is updating the snapshots to the latest version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I made a few small adjustments but this is great, thanks for the help @MicheleBertoli. |
Awesome, thanks @cpojer. |
* Add snapshot testing FAQs * Update SnapshotTesting.md
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
There are a few common misconceptions around snapshot testing that always come out when engineers are approaching this technique for the first time.
The new "frequently asked questions" section aims to answer the most common ones, giving clarity to the engineers.
These questions have been collected during conferences, meetups and within issues and PRs.
Test plan