Skip to content

Commit 368959f

Browse files
authored
docs: update testing example to check data (TanStack#2664)
1 parent c956f1a commit 368959f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/pages/guides/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ await waitFor(() => {
121121
return result.current.isSuccess;
122122
});
123123
124-
expect(result.current).toEqual({answer: 42});
124+
expect(result.current.data).toEqual({answer: 42});
125125
```
126126

127127
Here we are making use of `waitFor` and waiting until our the query status indicates that the request has succeeded. This way we know that our hook has finished and should have the correct data.

0 commit comments

Comments
 (0)