The post that prompted this:
hmm I guess I am trying to test the function more broadly. Using the database is part of testing the function or api endpoint in this case. I'm open to the idea of mocking. It's something I've never done so would be nice to learn a little about. But ideally I would like to use an actual database. Strategies for both mocking and a real database would be nice. I'm more at the stage of learning about how I could about testing these things. I essentially want to do, POST some data, I do some logic, make some db calls and I want to confirm that the state of things on the db is what I expect. Or I guess this is more accurate, I'm testing an API endpoint that happens to make some db calls. what is the difference between mock out the database and interactions with a real database?
the latter is slow and annoying and only gets slower and more annoying as your system gets more complex. Do you spin up, seed, and tear down a new database every time you want to run tests? do you have a lo