Skip to content

Commit

Permalink
docs: recommend vitest browser mode (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebuilder authored Nov 21, 2024
1 parent 18bd2bd commit 3b2e0ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ You can read more about this on these links:
## Testing
> [!TIP]
> Consider using [Vitest Browser Mode](https://vitest.dev/guide/browser/) instead of `jsdom` or `happy-dom`.
> 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.
In order to write meaningful tests, the `IntersectionObserver` needs to be
mocked. You can use the included `react-intersection-observer/test-utils` to
help with this. It mocks the `IntersectionObserver`, and includes a few methods
Expand Down

0 comments on commit 3b2e0ea

Please sign in to comment.