You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fetchMock.mock(matcherFunc,200).mock(matcherFunc2,200).$mock2fetchMock.called('mock2')// gets the calls actually handled by matcherFuncfetchMock.called(matcherFunc2)// gets the calls that matcherFunc matches
With the easier naming the expectation is that its use for tricky cases like this will become more widespread, and can drop the annoying use of matchers as identifier, and completely rethinnk the inspection methods
For advanced matching it's beneficial - for determinism and clarity - to add an explicit name to a route via the options parameter:
I've never liked this api, but thankfully never have to use it
Syntactic sugar for this would be to add a
.name()
method which sets the name of the last added routeOr alternatively, an ES Proxy could be used to support behaviour like the following
Final idea, support switching fetch-mock into 'name first' mode (this could also be via setting a config property):
Leaving this issue here for feedback
The text was updated successfully, but these errors were encountered: