rusqlite_migration icon indicating copy to clipboard operation
rusqlite_migration copied to clipboard

Integrate with Insta for testing

Open cljoly opened this issue 7 months ago • 0 comments

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):

  1. [x] Version snapshots of the Migrations along with the code. We should already support this, thanks to the Debug serialisation implemented on this struct.
  2. [ ] 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.

cljoly avatar Dec 06 '23 00:12 cljoly