MCPcopy Create free account
hub / github.com/TabularisDB/tabularis / createLocalStorageStub

Function createLocalStorageStub

tests/hooks/useRowEditorResize.test.ts:8–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const STORAGE_KEY = "tabularis_row_editor_sidebar_width";
7
8const createLocalStorageStub = () => {
9 const store = new Map<string, string>();
10 return {
11 getItem: (k: string) => (store.has(k) ? store.get(k)! : null),
12 setItem: (k: string, v: string) => {
13 store.set(k, String(v));
14 },
15 removeItem: (k: string) => {
16 store.delete(k);
17 },
18 clear: () => store.clear(),
19 key: (i: number) => Array.from(store.keys())[i] ?? null,
20 get length() {
21 return store.size;
22 },
23 };
24};
25
26describe("useRowEditorResize", () => {
27 beforeEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected