Not two days ago I had the thought that it'd be so nice if I could write tests that were just plain text HTTP requests, and that the assertions would be just be comparing the responses to stored plain text HTTP responses, kind of like how snapshot assertions works in the React world. From a cursory glance this looks even better than what I had in mind, can't wait to give it a spin.
That's definitely more convenient. I think it could be nice to have an additional test suite not written in the same language as the thing you're testing. It would force you to interact with your program the way the rest of the world would. Rather than relying on mocking, setting up test data, and reaching into the internals of your code, you have to set up your test data through the API. This wouldn't be feasible in most of work I've done in my professional career, but in an ideal world I think it could be beneficial not to rely on internals for testing, at least for some set of tests.
Yes, that’s generally a good thing to do. This tool has the potential to be much more useful for consumers of your service to document it or interact with it.
It’s not so hard to make this in any language. Just emit output to a text file and have a flag in your test command to overwrite the snapshots instead of asserting that the current output matches the snapshot.
I found that I didn’t even use assertions sometimes. I’d just check git to see if there’s a diff in the snapshots for refactoring
Thank you so much for sharing!