-
-
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
Snapshots sorted alphabetically instead of the order generated in the test #3936
Comments
Agreed - see comment #3581 (comment) |
We won't be changing this. You can pass a name to |
@cpojer Why would you not consider changing this? Even if we pass in a label, we'll have to duplicate all of the strings in the describe blocks and then prepend every label with 001, 002, etc. just to get it to sort properly. |
@cpojer The issue isn't the labels of the snapshots, I actually like the labels being the same as the describe/it blocks. |
We aren't going to make this breaking change at this point and we won't be making this configurable. Sorting the snapshots alphabetically makes them stable, for example when tests are disabled. There is an escape hatch to provide the name of the snapshot and you can build your own matcher on top of this to make handling it easier. |
@cpojer I'm sorry but I don't understand how this would be a breaking change to make it configurable (since it could just default to its current behavior). I also am not sure what you mean when you say alphabetical sorting makes the snapshots stable. Regardless of that, can you please provide more info on this escape hatch and how one could go about handling what we're asking for? |
@cpojer By disabled tests, do you mean ones resulting obsolete snapshots? Could those just be sorted to the bottom in this case? |
In case anyone else really wants their snapshots in order, you can shim
|
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. |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Snapshots are listed in the .snap file alphabetically.
What is the expected behavior?
Snapshots are listed in the .snap file the same order they are created in the test, so it easy to line them up when tests have many snapshots. Maybe the sorting method could be defined as a config option.
The text was updated successfully, but these errors were encountered: