feat: Font options for the UI in larger screens, for code and screen fonts display
This commit is contained in:
29
src/test/setup.ts
Normal file
29
src/test/setup.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Test environment polyfills for Vitest running in `node` mode.
|
||||
* Provides a minimal localStorage implementation with clear() to satisfy hooks.
|
||||
*/
|
||||
|
||||
if (typeof globalThis.localStorage === 'undefined' || typeof globalThis.localStorage.clear !== 'function') {
|
||||
const store = new Map<string, string>();
|
||||
|
||||
globalThis.localStorage = {
|
||||
getItem(key: string) {
|
||||
return store.has(key) ? store.get(key)! : null;
|
||||
},
|
||||
setItem(key: string, value: string) {
|
||||
store.set(String(key), String(value));
|
||||
},
|
||||
removeItem(key: string) {
|
||||
store.delete(key);
|
||||
},
|
||||
clear() {
|
||||
store.clear();
|
||||
},
|
||||
key(index: number) {
|
||||
return Array.from(store.keys())[index] ?? null;
|
||||
},
|
||||
get length() {
|
||||
return store.size;
|
||||
},
|
||||
} as unknown as Storage;
|
||||
}
|
||||
Reference in New Issue
Block a user