MCPcopy
hub / github.com/simstudioai/sim / createFakeRedis

Function createFakeRedis

apps/sim/lib/oauth/__tests__/terminal-errors.test.ts:23–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23function createFakeRedis(): FakeRedis {
24 const store = new Map<string, string>()
25 return {
26 store,
27 set: vi.fn(async (key: string, value: string) => {
28 store.set(key, value)
29 return 'OK'
30 }),
31 get: vi.fn(async (key: string) => store.get(key) ?? null),
32 del: vi.fn(async (key: string) => (store.delete(key) ? 1 : 0)),
33 }
34}
35
36beforeEach(() => {
37 vi.clearAllMocks()

Callers 1

Calls 3

setMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected