mirror of
https://github.com/LukeHagar/crossws.git
synced 2025-12-06 04:19:26 +00:00
20 lines
557 B
TypeScript
20 lines
557 B
TypeScript
import { describe, beforeAll, vi, afterAll } from "vitest";
|
|
import { wsTestsExec } from "../_utils";
|
|
import { WebSocketSSE } from "../../src/websocket/sse";
|
|
import * as undici from "undici";
|
|
|
|
globalThis.EventSource = globalThis.EventSource || (undici.EventSource as any);
|
|
|
|
describe("sse", () => {
|
|
beforeAll(() => {
|
|
vi.stubGlobal("WebSocket", WebSocketSSE);
|
|
});
|
|
afterAll(() => {
|
|
vi.unstubAllGlobals();
|
|
});
|
|
wsTestsExec("deno run --unstable-byonm -A ./sse.ts", {
|
|
adapter: "sse",
|
|
resHeaders: false, // works but not testable
|
|
});
|
|
});
|