Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
TypeScript
at apifix
12345678910111213141516171819202122232425262728293031323334353637// Test double for @openstatus/upstash, swapped in via --import-map. Backs the// Redis client with the in-memory `__testRedisStore` Map so tests can assert// on stored state without a real Upstash instance.import { testRedisStore as store } from "./state.ts";
const client = { get: (key: string) => Promise.resolve(store.get(key) ?? null), set: (key: string, value: string) => { store.set(key, value); return Promise.resolve("OK"); }, del: (key: string) => { const existed = store.has(key) ? 1 : 0; store.delete(key); return Promise.resolve(existed); }, getdel: (key: string) => { const value = store.get(key) ?? null; store.delete(key); return Promise.resolve(value); }, incr: (key: string) => { const next = Number(store.get(key) ?? 0) + 1; store.set(key, String(next)); return Promise.resolve(next); }, expire: () => Promise.resolve(1),};
export const redis = client;
export const Redis = { fromEnv() { return client; },};