import { describe, expect, test } from "bun:test"; import { MemoryCacheStore } from "@/external/storage/cache/MemoryCacheStore.js"; import { runCacheStoreContract } from "./cacheStore.contract.js"; let now = 1_000; runCacheStoreContract({ name: "MemoryCacheStore", createStore: () => new MemoryCacheStore({ now: () => now }), advanceTime: (ms) => { now += ms; }, }); describe("MemoryCacheStore metadata", () => { test("reports memory backend with strong consistency", () => { const store = new MemoryCacheStore({ now: () => now }); expect(store.metadata).toEqual({ backend: "memory", consistencyMode: "strong", }); }); });