i mock all my db functions in my tests
but if you'd want to test your actual sql then it's time to go down the rabbit hole
Thanks. One of the things that draws me to hugsql is the attitude of just directly using Postgres facilities (eg jsonb, triggers used sparingly), so there’s less testing surface than a ORM, but still some.
So now I’m imagining a rabbit hole in using spec to generate some of those mocks, and a smaller, slower, not-always-run test suite (like a performance suite) that hits a disposable test database.
(But when I notice I’m inventing things in my brain, I’ve come to take that as a signal that I should be looking harder for other people’s guidance).
i prefer to write my own mocks and focus on their edge cases
if hitting the db isn't an issue though then don't hold back
i just enjoy my tests running in seconds instead of the 15 minutes a rails app can take (with 8-parallel)
yeah, I think I can stand up a second db with not too much trouble.
And a possibly stupid idea for integrating spec (enabling generative testing, dev-time instrumentation). Motivation is that I just want everything in one place.