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
stubRequest for specific method? #5
Comments
Fixed in our fork: https://github.com/stoplightio/moxios. |
Tobbe
added a commit
to Tobbe/moxios
that referenced
this issue
Oct 22, 2017
The jsdoc comment mentioned the posibility to specify what method to stub, but the actual code didn't support it. Now it does. To match the documentation and other stub functions the `method` parameter is the first parameter. To keep the code backwards compatible this parameter needed to be optional. That unfortunately made the actual implementation a litte bit messy. Fixes axios#5
mzabriskie
pushed a commit
that referenced
this issue
Jun 10, 2020
The jsdoc comment mentioned the posibility to specify what method to stub, but the actual code didn't support it. Now it does. To match the documentation and other stub functions the `method` parameter is the first parameter. To keep the code backwards compatible this parameter needed to be optional. That unfortunately made the actual implementation a litte bit messy. Fixes #5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only reason why my team hasn't switched from axios-mock-adapter to this is that we can't mock a specific method with moxios. Will this be supported in the future? I can possibly submit a PR but it would be nice with some guidance. Possibly as another argument to stubRequest?
Here's the chunk of code that gives the functionality in axios-mock-adapter: https://github.com/ctimmerm/axios-mock-adapter/blob/811a6a73de6bec643d64fa619fee136a0e3e841f/src/index.js#L86
The text was updated successfully, but these errors were encountered: