2 years ago
Wed Sep 27, 2023 10:21am PST
Ask HN: How do you run integration tests involving third party HTTP services?
Some approaches that come to mind:

- Convert the integration test to a "tighter" unit test which completely mocks the external service, thus effectively not firing any HTTP request

- Run a proxy/mock server intercepting all requests that responds with mock data, thus accepting and responding to HTTP requests. An example: https://mock-server.com

Most third party APIs do not provide a sandbox or a dry-run mode so this is a recurring topic.

I'm using Node.js so if you know of any node-specific tool, it'd be great!

comments:
add comment
loading comments...