Skip to content

Commit c582029

Browse files
committed
correct comment
1 parent 13bfcc2 commit c582029

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

versioned_docs/version-7.x/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ test('Display loading state while waiting for data and then fetched profile nick
879879

880880
We query tab buttons and mock fetch function using `spyOn` and `mockImplementation`. We navigate to profile screen and check if loading state is rendered correctly. Then, to check if fetched data is displayed correctly we use `findByText` - we need to wait for the fetch to finish before checking it's result. To ensure that operation will succeed on every focus, we navigate back to home, then to settings and check rendered content again.
881881

882-
To make test deterministic and isolate it from the real backend you can mock fetch function. `mockedFetch` will override real implementation of fetch and `spyOn` will enable you to check number of function calls.
882+
To make test deterministic and isolate it from the real backend you can mock fetch function. You can use `spyOn` to override real implementation of fetch with `mockedFetch`.
883883

884884
```js
885885
// Mock implementation of fetch function
@@ -906,7 +906,7 @@ test('display loading state while waiting for data and then fetched profile nick
906906

907907
// ...
908908

909-
// Check number of mock fetch calls
909+
// Check if mock fetch was called
910910
expect(spy).toHaveBeenCalled();
911911

912912
// ...

0 commit comments

Comments
 (0)