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

Update web-interceptor.js #262

Merged
merged 1 commit into from Oct 20, 2018
Merged

Update web-interceptor.js #262

merged 1 commit into from Oct 20, 2018

Conversation

kmichal
Copy link
Contributor

@kmichal kmichal commented Oct 16, 2018

Fixing getMatchingMock method so that it returns a matching mock only if it's active

Fixing getMatchingMock method so that it returns a matching mock only if it's active
@morsdyce
Copy link
Owner

Thanks!

I think this might have been a bug I've fixed in the master branch and didn't pull into next.
did it happen to you in the currently released version?

@kmichal
Copy link
Contributor Author

kmichal commented Oct 18, 2018

I think I have 2.0.7
Is the version used on mimic.js.org the latest one?
If it is then there is still an issue.

If you play around with the two mocks that point to http://500tech.github.io/mimic/api/content
you'll notice that as you enable one and disable the other you'll see a 404 in one case because
getMatchingMock always returns the first matching mock no matter whether its active or not.
If it's not active there is a real call which fails with a 404.

@morsdyce morsdyce merged commit f7ac245 into morsdyce:next Oct 20, 2018
@morsdyce
Copy link
Owner

Thank you so much for catching this!
I'll apply this fix to the master branch as well and release a new version.

morsdyce pushed a commit that referenced this pull request Oct 20, 2018
…red active status of the mock (#262)

When having 2 or more mocks on the same route, we tried to get the first matching mock, however we did not check if the mock is disabled.
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 this pull request may close these issues.

None yet

2 participants