UNPKG

window-resizeto

Version:

A window.resizeTo polyfill for test environments like Jest & JSDOM

9 lines (8 loc) 257 B
export function resizeTo (windowObj: any, width: number, height: number): void { Object.assign(windowObj, { innerWidth: width, innerHeight: height, outerWidth: width, outerHeight: height }).dispatchEvent(new windowObj.Event('resize')) }