()
| 37 | }; |
| 38 | |
| 39 | const createMockStorage = (): MockStorage => { |
| 40 | const map = new Map<string, StorageValue>(); |
| 41 | return { |
| 42 | get: async <Value>(key: string): Promise<Value | undefined> => |
| 43 | map.get(key) as Value | undefined, |
| 44 | list: async <Value>(): Promise<Map<string, Value>> => |
| 45 | map as unknown as Map<string, Value>, |
| 46 | put: async (entries: {[key: string]: StorageValue}): Promise<void> => { |
| 47 | Object.entries(entries).forEach(([key, value]) => map.set(key, value)); |
| 48 | }, |
| 49 | delete: async (keys: string[]): Promise<void> => { |
| 50 | keys.forEach((key) => map.delete(key)); |
| 51 | }, |
| 52 | }; |
| 53 | }; |
| 54 | |
| 55 | const createMockEnvironment = ( |
| 56 | config: TinyBasePartyKitServerConfig = {}, |
no test coverage detected
searching dependent graphs…