This commit is contained in:
2026-02-16 19:34:35 +00:00
commit 9ab0940ca4
784 changed files with 41710 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import { GlobalWindow } from 'happy-dom';
const window = new GlobalWindow();
// Copy window properties to globalThis
Object.assign(globalThis, {
window,
document: window.document,
navigator: window.navigator,
location: window.location,
history: window.history,
HTMLElement: window.HTMLElement,
Element: window.Element,
Node: window.Node,
Event: window.Event,
CustomEvent: window.CustomEvent,
MouseEvent: window.MouseEvent,
KeyboardEvent: window.KeyboardEvent,
InputEvent: window.InputEvent,
FocusEvent: window.FocusEvent,
DocumentFragment: window.DocumentFragment,
MutationObserver: window.MutationObserver,
ResizeObserver: window.ResizeObserver,
getComputedStyle: window.getComputedStyle.bind(window),
requestAnimationFrame: window.requestAnimationFrame.bind(window),
cancelAnimationFrame: window.cancelAnimationFrame.bind(window),
setTimeout: window.setTimeout.bind(window),
clearTimeout: window.clearTimeout.bind(window),
setInterval: window.setInterval.bind(window),
clearInterval: window.clearInterval.bind(window),
});