-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to do unit/integration/end-to-end tests with 3rd party APIs (backend)? #9
Comments
Mocking the google API response would probably be easier to implement. Really, need to only test the functionality of Gairos against a stub of the Google API... Which would probably make this more of a unit test. Anything that needs to interact with out the Gairos API can be integration tested on its own... |
E2e graphql server testing examples: https://blog.logrocket.com/writing-end-to-end-tests-for-graphql-servers-using-jest/ |
E2e would test all of the app as if you were an end user. You would likey mock out any external services (backend 3rd party api responses, maybe database connections etc... it really all depends) |
If you would like to do e2e testing across both the front and back end, it may be ideal to use the CDC approach. If not, you would generally peogramatically query the app individually, and ensure that it responds a certain way. You may implement services, like databases, in these tests. I.e.) use an http client to query an endpoint, and ensure that the response body is what it is expected to be. You may use any external services (database, etc.) If you can. Ideally, you should (but do not include the front end. If you decide to go that far, it looks like CDC is the way to go). |
|
Implemented unit + integration as of: 46ac50a Placing on hold for e2e |
Refs: https://medium.com/@axelhodler/integration-tests-for-third-party-apis-dab67c52e352
The text was updated successfully, but these errors were encountered: