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,28 +1,11 @@
import path from "node:path";
import { describe, expect, it } from "vitest";
import { captureEnv } from "../test-utils/env.js";
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 skills.status", () => {
it("does not expose raw config values to operator.read clients", async () => {
const envSnapshot = captureEnv(["OPENCLAW_BUNDLED_SKILLS_DIR"]);