Skip to content

Commit a1a32eb

Browse files
committed
docs: metnion jsdom and matchMedia api
1 parent 985d066 commit a1a32eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/src/content/docs/reference/testing.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ module.exports = {
5858
}
5959
```
6060

61+
### Testing on web with JSDOM
62+
63+
When utilizing JSDOM for testing purposes, it is required to provide the implementation
64+
for `window.matchMedia`, as this functionality is absent in JSDOM, yet it is a dependency for Unistyles.
65+
66+
For a comprehensive approach, refer to the official `jest` documentation on [mocking methods that are not implemented in JSDOM](https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom).
6167
### Support
6268

6369
Mocks support basic operations and are designed to mimic the setting of themes and breakpoints.

0 commit comments

Comments
 (0)