Exvcr records your http requests into a text file that you can commit and replays when running tests later. It also offers an inline stub functionality to avoid having to manage cassette files.
Here is how I recommend using it:
- Manually capture requests and responses using console and use inline stubs only
- Implement a test support module which uses environment variables for secrets and includes helper functions for invoking each endpoint and outputting request and response to stdout
- Match on request body and url params to ensure your code is generating the right parameters
- Let your code under test accept a recv timeout argument. Use artificially short timeouts in console and capture the example responses for online stubs.
Top comments (0)