Tldraw/packages/editor/setupTests.js

16 wiersze
358 B
JavaScript

require('fake-indexeddb/auto')
global.ResizeObserver = require('resize-observer-polyfill')
global.crypto ??= new (require('@peculiar/webcrypto').Crypto)()
global.FontFace = class FontFace {
load() {
return Promise.resolve()
}
}
document.fonts = {
add: () => {},
delete: () => {},
forEach: () => {},
[Symbol.iterator]: () => [][Symbol.iterator](),
}