Cleaned up docs and added `once` alias
Clearly I haven't done a release here on github as I didn't know what I was doing when I first started this package. This release is mainly documentation clean up. I've added a simple example without redux and I've also added another example showing some of the underlying mock capabilities of Jest. I've also added the once
alias for mockResponseOnce
. With mockResponseOnce
returning the mock function you can chain your responses and the syntax might be nicer than mockResponses
:
it('tests my api', () => {
const s = JSON.stringify
fetch
.once(s({ data: '12345'}))
.once(s({ data: '67890'}))
}
Other future plans will be to include more simple examples that do not require on redux as it seems to fallen out of favour recently!