test-event-store.ts 477 B

123456789
  1. import { InMemorySessionEventStore, type SessionEventStorePort } from "@zcode/contracts";
  2. /**
  3. * core 测试用的 event store 直接复用 contracts 的生产实现,避免手写替身与生产行为漂移。
  4. * 这里选 `unbounded`:core 测试关注 runtime 语义,不验证保留策略,保留全部事件便于断言。
  5. */
  6. export function createTestSessionEventStore(): SessionEventStorePort {
  7. return new InMemorySessionEventStore({ retention: "unbounded" });
  8. }