Skip to content

Commit

Permalink
Merge pull request #699 from intuit/window-test-guard
Browse files Browse the repository at this point in the history
Guard against `window` not existing in test setup
  • Loading branch information
adierkens authored May 31, 2022
2 parents 53e1a0e + a124f97 commit be393c5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions plugins/test/src/jest/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */

window.matchMedia =
window.matchMedia ||
function() {
return {
matches: false
if (typeof window !== 'undefined') {
window.matchMedia =
window.matchMedia ||
function() {
return {
matches: false
};
};
};
}


// @ts-ignore
if (global.document) {
Expand Down

0 comments on commit be393c5

Please sign in to comment.