4 ms·
> Yes, if you change your API you need to update your tests anyway. And if you mock your responses you can easily edit it to update it to the latest version of
by royjacobs 10y ago
> Yes, if you change your API you need to update your tests anyway.
And if you mock your responses you can easily edit it to update it to the latest version of the API.
This "tape" approach leaves you with a bunch of opaque blobs that may or may not be easy to recreate or update, since they require a server to be in a specific state to create them in the first place.
- Osiris 10y agoI don't like recording requests/responses because of this. In these cases, I prefer to manually write the test without running the code because I want to make sure the test matches what I expect my code to do, not record what it actually does. I caught an error yesterday in which a recorded response was used as an expectation, so the test passed. The bug was only exposed when I wrote a new test and manually created the request/response objects based on the docs. The test failed and I found the bug (a field was being transposed during transform of the response).