Skip to content

Commit b72838f

Browse files
jefflauloris
authored and
loris
committed
Update readme
1 parent ea0bb59 commit b72838f

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

README.md

+1-17
Original file line numberDiff line numberDiff line change
@@ -491,25 +491,9 @@ describe('testing api', () => {
491491

492492
By default you will want to have your fetch mock return immediately. However if you have some custom logic that needs to tests for slower servers, you can do this by passing it a function and returning a promise when your function resolves
493493

494-
```js
495-
// api.js
496-
497-
import 'cross-fetch'
498-
499-
export function APIRequest(who) {
500-
if (who === 'facebook') {
501-
return fetch('https://facebook.com')
502-
} else if (who === 'twitter') {
503-
return fetch('https://twitter.com')
504-
} else {
505-
return fetch('https://google.com')
506-
}
507-
}
508-
```
509-
510494
```js
511495
// api.test.js
512-
import { APIRequest } from './api'
496+
import { request } from './api'
513497

514498
describe('testing timeouts', () => {
515499
it('resolves with function and timeout', async () => {

0 commit comments

Comments
 (0)