Skip to content

Commit a124f97

Browse files
authored
Update setupTests.ts
1 parent 7b27891 commit a124f97

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

plugins/test/src/jest/setupTests.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/* eslint-disable @typescript-eslint/ban-ts-comment */
22

3-
window.matchMedia =
4-
window.matchMedia ||
5-
function() {
6-
return {
7-
matches: false
3+
if (typeof window !== 'undefined') {
4+
window.matchMedia =
5+
window.matchMedia ||
6+
function() {
7+
return {
8+
matches: false
9+
};
810
};
9-
};
11+
}
12+
1013

1114
// @ts-ignore
1215
if (global.document) {

0 commit comments

Comments
 (0)