47 lines · 1.1 KB · TypeScript
RawDownload
process.env.BIRDCLAW_DISABLE_LIVE_WRITES ??= "1";// Existing integration fixtures opt into the same sample dataset as `init --demo`.process.env.BIRDCLAW_TEST_SEED_DEMO_DATA = "1"; export {}; function installMemoryStorage(	target: object,	key: "localStorage" | "sessionStorage",) {	const store = new Map<string, string>();	const memoryStorage = {		getItem(key: string) {			return store.has(key) ? (store.get(key) ?? null) : null;		},		setItem(key: string, value: string) {			store.set(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;		},	}; 	Object.defineProperty(target, key, {		configurable: true,		value: memoryStorage,	});} installMemoryStorage(globalThis, "localStorage");installMemoryStorage(globalThis, "sessionStorage"); if (typeof window !== "undefined") {	installMemoryStorage(window, "localStorage");	installMemoryStorage(window, "sessionStorage");} await import("@testing-library/jest-dom/vitest");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t