Options for mocking 3rd party services to avoid network calls (from the Rails code) ?
Opened this issue · 0 comments
galori commented
I saw the other issue asking about getting VCR working, and it's likely requirement for running Puma single threaded.
What are the other options in this context? Possibilities:
- "test mode" in each client library
- WebMock?
- Using RSpec mocks?
- Use standalone service HTTP server or proxy to respond with fake responses
- Any other options? What is everyone else doing?
Option 1: Doesn't work for my use case (we integrate with hundreds of 3rd party libraries).
Option 2: Could WebMock work? Would it need to be run in single thread mode like VCR?
Option 3: Could be interesting but also clunky. Might require RSpec to launch Cypress from within examples, similar to how Capybara works
Option 4: Any recommendation? I found http-mock-server but it has been archived. mock-server seems neat and feature complete but requires java (would like to avoid introducing new tech) and also seems fairly "heavy".