()
| 21 | } |
| 22 | |
| 23 | function 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 | |
| 36 | beforeEach(() => { |
| 37 | vi.clearAllMocks() |
no test coverage detected