rusqlite_migration
rusqlite_migration copied to clipboard
Integrate with Insta for testing
Insta is a popular snapshot testing tool for Rust. I’m not too familiar with it, but it seems that this library could be integrated with it in two ways (they are not exclusive):
- [x] Version snapshots of the
Migrations
along with the code. We should already support this, thanks to theDebug
serialisation implemented on this struct. - [ ] Just like we have a
validate
method for testing convenience, we could also have a method that outputs the final state of the database (or of the internal tables holding the schema?) after running all the migrations. That would be what insta would snapshot.
- [ ] The use of all those features should be documented in the Readme.
- [ ] This may be a good chance to introduce insta on our own tests.
It would go some way to achive the goals of #101, but in less complex and intrusive way:
- it would be just a fuction, and
- it would compose with the framework users already use for snapshot testing.