Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { makeProviderReplayGate } from "./ProviderReplayGate.testkit.ts";
4
5describe("ProviderReplayGate", () => {
6 it("stops waiting when the replay consumer is interrupted", async () => {
7 const label = "held-frame";
8 const gate = makeProviderReplayGate([label]);
9 const controller = new AbortController();
10 const waiting = gate.beforeEmit(label, controller.signal);
11
12 expect(gate.hasReached(label)).toBe(true);
13 controller.abort();
14 await waiting;
15 expect(gate.release(label)).toBe(true);
16 });
17});