Window ResizeTo Polyfill for Test Environments

JSON →
library 0.0.2 ·javascript
verified May 27, 2026

The `window-resizeto` package provides a polyfill and ponyfill for the `window.resizeTo` method, specifically designed for JavaScript test environments such as Jest and JSDOM. It addresses the common limitation in these environments where `window.resizeTo` is not natively implemented, leading to failures in tests that depend on window resizing functionality. The current stable version is 0.0.2, indicating it's still in early development, though seemingly stable for its intended purpose. Its release cadence appears infrequent, driven by specific fixes or minor enhancements. Key differentiators include its small footprint (under 10 lines of code) and its dual approach, offering both a global polyfill (`window-resizeto/polyfill`) and an explicit ponyfill function (`resizeTo`) for greater control. It effectively simulates window resizing by manipulating `outerWidth`, `outerHeight`, `innerWidth`, and `innerHeight` properties and dispatching a `resize` event, making it a drop-in solution for testing responsive UIs or logic tied to window dimensions without needing a full browser environment.

total hits 18
actors 5 distinct systems
last hit 1d ago human
GPTBot
5
MetaBot
4
Script
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany