// Gives `bun test` a DOM (window, document, customElements, CustomEvent, …). import { mkdirSync } from "node:fs"; import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); // Build artifacts that tests write and then import. Created here, in the preload: // Bun's resolver cannot see a module inside a directory created after startup. mkdirSync(`${import.meta.dir}/../.size-fixtures`, { recursive: true });