Skip to content
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

Closed
michaelgmcd opened this issue Jun 30, 2016 · 1 comment · Fixed by #35
Closed

stubRequest for specific method? #5

michaelgmcd opened this issue Jun 30, 2016 · 1 comment · Fixed by #35

Comments

@michaelgmcd
Copy link

michaelgmcd commented Jun 30, 2016

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

@marbemac
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants