Files
suaveplan/packages/commerce/contacts/api-plugin-contacts/src/context/context.test.ts
2026-05-27 23:29:53 +01:00

20 lines
721 B
TypeScript

import { describe, expect, it } from "@suaveplan/testing/runner";
import { Hono } from "hono";
import "./context.js";
describe("ContextVariableMap augmentation", () => {
it("ContextVariableMap exposes contactRepository slot typed as SurrealContactRepository", {
timeout: 5000,
}, async () => {
const app = new Hono();
app.get("/probe", (c) => {
// The compile-time guarantee is what matters; at runtime we
// verify `c.set` accepts the value without throwing.
c.set("contactRepository", undefined as never);
return c.text("ok");
});
const res = await app.request("/probe");
expect(res.status).toBe(200);
});
});