Skip to content

Commit 3b2e0ea

Browse files
authored
docs: recommend vitest browser mode (#707)
1 parent 18bd2bd commit 3b2e0ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ You can read more about this on these links:
238238
239239
## Testing
240240
241+
> [!TIP]
242+
> Consider using [Vitest Browser Mode](https://vitest.dev/guide/browser/) instead of `jsdom` or `happy-dom`.
243+
> This option allows you to utilize the real browser implementation and triggers correctly when scrolling or adding elements to the viewport. You can skip the `react-intersection-observer/test-utils`, or use it as needed.
244+
241245
In order to write meaningful tests, the `IntersectionObserver` needs to be
242246
mocked. You can use the included `react-intersection-observer/test-utils` to
243247
help with this. It mocks the `IntersectionObserver`, and includes a few methods

0 commit comments

Comments
 (0)