2026-05-11 23:35:52 +00:00

15 lines
468 B
JavaScript

import 'fake-indexeddb/auto'
// jsdom does not provide crypto.subtle — polyfill it with the real Web Crypto API
// (available in Node 19+ as `node:crypto.webcrypto`)
if (typeof globalThis.crypto === 'undefined' || !globalThis.crypto.subtle) {
const { webcrypto } = await import('node:crypto')
globalThis.crypto = webcrypto
}
// Mock window/document APIs used by security store
Object.defineProperty(globalThis, 'navigator', {
value: {},
writable: true,
})