Fix tests not running

This commit is contained in:
thepaperpilot 2023-02-15 23:15:55 -06:00
parent e6dd4bf332
commit fb02699cb0

View file

@ -54,4 +54,8 @@ export interface GlobalEvents {
/** A global event bus for hooking into {@link GlobalEvents}. */
export const globalBus = createNanoEvents<GlobalEvents>();
if ("fonts" in document) {
// This line breaks tests
// JSDom doesn't add document.fonts, and Object.defineProperty doesn't seem to work on document
document.fonts.onloadingdone = () => globalBus.emit("fontsLoaded");
}