Skip to content

Cleaned up docs and added `once` alias

Compare
Choose a tag to compare
@jefflau jefflau released this 21 Mar 08:15
· 130 commits to master since this release

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!