You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mocks `matchMedia`, allows testing of component's behavior depending on the viewport description (supports all of the [Media Features](http://www.w3.org/TR/css3-mediaqueries/#media1)). `mockViewport` must be called before rendering the component
12
12
13
13
Example, using `React Testing Library`:
14
-
15
14
```jsx
16
15
import { mockViewport } from'jsdom-testing-mocks"
17
16
@@ -34,6 +33,23 @@ it('shows the right lines on desktop and mobile', () => {
34
33
})
35
34
```
36
35
36
+
Also, you can mock the viewport for a group of tests, using `mockViewportForTestGroup`:
37
+
```jsx
38
+
import { mockViewportForTestGroup } from 'jsdom-testing-mocks"
0 commit comments