Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys authored Mar 12, 2020
1 parent ade6223 commit 7f7c5b3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,24 @@ test(async () => {
}, 405)

expect(await userManager.getAll()).toEqual([{name: 'bob'}])
expect(fetchMock).toHaveLastFetched('http://example.com/users', 'get')
await userManager.create({name: true})
expect(fetchMock).toHaveLastFetched({
url: 'http://example.com/user',
body: {name: true}
}, 'post')
expect(await userManager.getAll()).toEqual([{name: 'bob'}])
fetchMock.mockClear()
await userManager.create({name: 'sarah'})
expect(await userManager.getAll()).toEqual([{name: 'bob'}, {name: 'sarah'}])
fetchMock.clear()
expect(fetchMock).toHaveLastFetched({
url: 'http://example.com/user',
body: {name: 'sarah'}
}, 'post')
expect(await userManager.getAll()).toEqual([
{name: 'bob'},
{name: 'sarah'}
])
fetchMock.mockReset()
})

```

0 comments on commit 7f7c5b3

Please sign in to comment.