Skip to content

Commit

Permalink
Fix node test again
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 24, 2017
1 parent c355eae commit d0d6e10
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ if (typeof window !== 'undefined') {
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;

const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>';
global.document = jsdom(documentHTML);
global.window = document.parentWindow;

global.window.resizeTo = (width, height) => {
global.window.innerWidth = width || global.window.innerWidth;
global.window.innerHeight = height || global.window.innerHeight;
global.window.dispatchEvent(new Event('resize'));
};
}

global.requestAnimationFrame = global.requestAnimationFrame || function (cb) {
return setTimeout(cb, 0);
};

const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>';
global.document = jsdom(documentHTML);
global.window = document.parentWindow;

global.window.resizeTo = (width, height) => {
global.window.innerWidth = width || global.window.innerWidth;
global.window.innerHeight = height || global.window.innerHeight;
global.window.dispatchEvent(new Event('resize'));
};

0 comments on commit d0d6e10

Please sign in to comment.