This commit is contained in:
pa
2026-03-16 16:01:07 +09:00
parent 4c6f80277e
commit fadead9c80
24 changed files with 183 additions and 92 deletions

View File

@@ -49,6 +49,19 @@ Object.defineProperty(window, 'matchMedia', {
}))
});
// localStorage polyfill (jsdom may not provide a full implementation)
if (typeof globalThis.localStorage === 'undefined' || typeof globalThis.localStorage.clear !== 'function') {
const store = new Map();
globalThis.localStorage = {
getItem: (key) => store.get(key) ?? null,
setItem: (key, value) => store.set(key, String(value)),
removeItem: (key) => store.delete(key),
clear: () => store.clear(),
get length() { return store.size; },
key: (index) => [...store.keys()][index] ?? null
};
}
// Notification API stub
globalThis.Notification = class {
static permission = 'denied';