sunb26 / xat

Multi-Modal App targeted to small/med businesses to scan receipts and invoices images for auto tax filing
0 stars 0 forks source link

selecting golang database mocking lib/tool #139

Open sunb26 opened 6 months ago

sunb26 commented 6 months ago

Starting Suggestions

  1. Go-SQLMock (This one seems like the standard) https://github.com/DATA-DOG/go-sqlmock

  2. testify/mock package (Have not looked too deep into this one yet)

  3. Just Use Real Database but use transactions and rollback at the end of each test

Thoughts @Lev1ty @Zack-Ren ????

Lev1ty commented 6 months ago

well i was hoping to see options 2 and 3 be alternative db mocking packages, but this works too to start

  1. this looks promising package documentation but would like to see alternatives as well
  2. please take the time and effort to dig into it before posting to reduce wait and toil in the conversation
  3. do not do this as it adds a networked dependency to the unit test. strive for hermetic unit tests, i.e. network, input, dependency (aside from the package it is testing) free