Supertest: Verify database after request
May 5, 2015
One thing that I often find myself want to do is to check the database after I have created a resource. For example:
- Post some data to /user
- Verify that I get 201 Created back
- Check that the data in the database looks ok
I have had such a hard time finding a stable way to do this. I know that I have a little bit of a special tool chain but still… it should not be this hard.
But last night, after weeks searching for this, I got it to work. I’m so excited to share this with you.