Skip to content

Commit 1621e61

Browse files
committed
Update docs/guide/advanced/http-requests.md
1 parent 97c40f5 commit 1621e61

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/guide/advanced/http-requests.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ test('loads posts on button click', async () => {
8484
})
8585
```
8686

87-
Pay attention that we added prefix `mock` to the variable `mockPostList`. If not, we will get the error: "The module factory of jest.mock() is not allowed to reference any out-of-scope variables."
88-
Additional info is located here: https://jestjs.io/docs/es6-class-mocks#calling-jestmock-with-the-module-factory-parameter.
87+
Pay attention that we added prefix `mock` to the variable `mockPostList`. If not, we will get the error: "The module factory of jest.mock() is not allowed to reference any out-of-scope variables.". This is jest-specific, and you can read more about this behavior [in their docs](https://jestjs.io/docs/es6-class-mocks#calling-jestmock-with-the-module-factory-parameter).
8988

9089
Also notice how we awaited `flushPromises` and then interacted with the Component. We do so to ensure that the DOM has been updated before the assertions run.
9190

0 commit comments

Comments
 (0)