refactor(channels): dedupe transport and gateway test scaffolds

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:15 +00:00
parent f717a13039
commit 93ca0ed54f
95 changed files with 4068 additions and 5221 deletions

View File

@@ -1,26 +1,9 @@
import { describe, expect, it } from "vitest";
import {
connectOk,
installGatewayTestHooks,
rpcReq,
startServerWithClient,
} from "./test-helpers.js";
import { connectOk, installGatewayTestHooks, rpcReq } from "./test-helpers.js";
import { withServer } from "./test-with-server.js";
installGatewayTestHooks({ scope: "suite" });
async function withServer<T>(
run: (ws: Awaited<ReturnType<typeof startServerWithClient>>["ws"]) => Promise<T>,
) {
const { server, ws, envSnapshot } = await startServerWithClient("secret");
try {
return await run(ws);
} finally {
ws.close();
await server.close();
envSnapshot.restore();
}
}
describe("gateway talk.config", () => {
it("returns redacted talk config for read scope", async () => {
const { writeConfigFile } = await import("../config/config.js");