requery icon indicating copy to clipboard operation
requery copied to clipboard

Initial test suite

Open adnelson opened this issue 6 years ago β€’ 3 comments

  • [ ] Query builder -- any non-trivial transformations
  • [ ] Query rendering
    • [ ] Postgres
    • [ ] Sqlite3
  • [ ] Create/Retrieve
    • [ ] Postgres
    • [ ] SQLite3

adnelson avatar Oct 06 '19 18:10 adnelson

It seams snapshot testing should give basic test coverage with little effort πŸ™‚

baransu avatar Oct 31 '19 22:10 baransu

Hmm, what did you have in mind? I'm not familiar with that approach, although I have some theories πŸ˜…

adnelson avatar Nov 01 '19 01:11 adnelson

It would be basicly constructing examples of queries, rendering them and dumping into snapshot. You can verify them by hand just by looking or using some sql validator. You have snapshots in repo all the time and after every change you verify agains snapshots if you have some unwanted regressions.

In Jest documentation it’s mentioned for UI but our usecase it also makes sense: https://jestjs.io/docs/en/snapshot-testing

baransu avatar Nov 01 '19 11:11 baransu