Something went wrong. Try again.
Fork of backnotprop/plannotator with reduced surface area
Something went wrong. Try again.
12345678910111213141516171819import { describe, expect, test, mock } from "bun:test";import { createExternalAnnotationHandler } from "./external-annotations";
describe("external annotations SSE", () => { test("disables idle timeout for stream requests", async () => { const handler = createExternalAnnotationHandler("plan"); const disableIdleTimeout = mock(() => {});
const res = await handler.handle( new Request("http://localhost/api/external-annotations/stream"), new URL("http://localhost/api/external-annotations/stream"), { disableIdleTimeout }, );
expect(disableIdleTimeout).toHaveBeenCalledTimes(1); expect(res?.headers.get("content-type")).toBe("text/event-stream"); });});