-
Notifications
You must be signed in to change notification settings - Fork 178
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
v5 proposals #101
Comments
|
GIven fetchMock
.mock('http://thing.com', 200)
.mock(/.*/, 404)
fetch('http://thing.com') // 200 any thoughts on whether |
I get your question.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Handling unmatched requests
Currently configured by passing
greed: 'good'|'bad'|false
in tomock()
. Inadvertently, this persists even afterrestore()
is called, which is a bug, but not necessarily worse behaviour than intended. What might be better is eithergreed
option. Less magic, smaller API.'*'
matcher, or maybe a.catch()
method to define how unmatched calls are handledGlobal config
Setting things such as
sendAsJson
)Accept a
Response
object as the responseCould also be worth exposing the response creator as a utility
Major API change
Having
method
as an optional second parameter makes modifying the API trickier.the API could change to
mock(matcher, response, options)
, with shorthands ofget()
,post()
etc.mockOnce()
,getOnce()
etc would also be nice (see below)Other things to consider
.mock(a, b).mock(c,d)
vs.mock([[a,b], [c,d]])
)... deprecate mocking arrays???The text was updated successfully, but these errors were encountered: