-
Notifications
You must be signed in to change notification settings - Fork 641
-
Notifications
You must be signed in to change notification settings - Fork 641
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 testing. #777
Comments
@sksamuel could you share a reason why you decided to not imolrment it in kotest? |
Perhaps we could list some desired use-cases here? I think it would be nice to be able to use various matchers for snapshot testing.. (For instance testing JSON equality, partial JSON equality, testing JSON Schema and so on) Sshould we have explicit methods for every matcher, or should snapshot testing take a matcher as argument? |
@Kantis I thought about the very basic use case in scope of the first iteration, which is dumping an object/collection and then exact comparison. Other marchers may be a good idea in the next iterations to enable checking of structures that contain some non-determinism, e. g. various order of elements - is that your intent? |
Sounds good. Still, as can be seen in the linked tool for snapshot testing, there's a lot of nuance. (How do we serialize? Should private properties matter? How can the user tweak these serialization options?) I also think there's a possibility here to add really good tooling. A previous workplace used snapshot testing, and if you ran a snapshot test in an interactive environment (e.g. if it detected intelliJ) it would pull up a diff view of the failure and let you choose whether to overwrite the snapshot interactively. I think that would be a really neat feature to add along the line :) I've also been mulling whether we can somehow make matchers snapshot-aware. E.g. if we somehow added a middleware in testing where you could call a |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Maybe some inspiration here:
https://github.com/Karumi/KotlinSnapshot
The text was updated successfully, but these errors were encountered: