Skip to content

Commit 241588a

Browse files
maksugrSimenB
authored andcommitted
Update MockFunctions.md (#6386)
1 parent 3a1afce commit 241588a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/MockFunctions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default Users;
133133

134134
Now, in order to test this method without actually hitting the API (and thus creating slow and fragile tests), we can use the `jest.mock(...)` function to automatically mock the axios module.
135135

136-
Once we mock the module we can provide a `mockReturnValue` for `.get` that returns the data we want our test to assert against. In effect, we are saying that we want axios.get('/users.json') to return a fake response.
136+
Once we mock the module we can provide a `mockResolvedValue` for `.get` that returns the data we want our test to assert against. In effect, we are saying that we want axios.get('/users.json') to return a fake response.
137137

138138
```js
139139
// users.test.js

0 commit comments

Comments
 (0)