-
Notifications
You must be signed in to change notification settings - Fork 461
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
Create A Mock Test Client #1193
Comments
@meggieveggie Thanks for the feedback. We usually recommend using stripe-mock for something like this which is what we use in our test suite. You can read more about this here: https://github.com/stripe/stripe-mock/ |
@remi-stripe My understanding of stripe-mock is that it is specifically used for integration tests and not unit tests. If this is not the case then I will try and use stripe-mock |
@meggieveggie thank you for this suggestion. You are correct in that stripe-mock is built mainly for integration tests, but it should still allow you to quickly test your integration without actually hitting the Stripe API. The limitation with stripe-mock is that it is stateless, so fetching objects you create in a test will not work. Also, the data made available is limited to that which we generate based off resource fixtures from within our API. We have been experimenting with ways around these limitations, but don't have anything readily available right now. |
to everybody still searching for a solution for unit tests without stripe mock I managed to mock without it in the way I explained here on Stack Overflow |
how it can be use in unit testing?. Can you refer any example |
Proposed Feature
After implementing the Golang SDK there could possibly be a better test suite that can be created. For instance the current issue I am having is mocking a response from:
My thinking here would be to approach this how kubernetes has with their fake client. I understand there are many ways to mock out responses (This could definitely be documented better). However it seems that having the ability to do something along the lines of:
without actually calling the API would make integration with your platform a lot more seamless and speed up the process.
The text was updated successfully, but these errors were encountered: