-
-
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
Snapshot summaries can be made even more delightful #3581
Comments
I am using snapshots to test complex objects and arrays, not only react components. btw |
I agree that this could be improved, for large snapshot files I also find myself searching for the specific snapshot. If you have some ideas that you would like to contribute here then I encourage you to create a PR! I created a PR #3660 to try and solve the issue I highlighted, would be great to hear your feedback |
Is it possible to add an option to disable creating new snapshots? I started developing in this way:
describe('sample', () => {
it('foo', () => {
expect('').toMatchSnapshot();
});
});
describe('sample', () => {
it('foo', () => {
const component = shallow(
<Foo />
);
expect(something).toMatchSnapshot();
});
});
When using this approach I don't need to find the code in snapshot files, but I think 1. step could be omitted. |
See #3693 |
+1 for configuring the order that snapshot files are generated. When I test react saga's, it would be very nice to be able to read the snapshot in the order the steps occur rather than alphabetical. The way it works now, it groups all of my dispatch tests together, all of my selector tests together, etc. because of alphabetical sorting "it should dispatch", "it should select"... It would be nice to have it sort in the same order as the test file, so I could put the snapshot file side by side with the test file and make sure everything is coming out properly. |
Will be in Jest 21 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After performing a test run jest always shows a Snapshot Summary as follows:
It would be really nice to have some more information about which test created the snapshot. The same goes for obsolete snapshots, it simply shows "1 obsolete snapshot found", I think it is really useful to have some more information such as the name of the obsolete snapshot for example to prevent users from accidentally deleting snapshots during refactoring for example.
I think that adding some more information to the summary can make the snapshot experience even more awesome!
What do you guys think?
If you feel that this feature is a worthy addition to Jest then I would be happy to work on it:)
The text was updated successfully, but these errors were encountered: