mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:18:26 +00:00
refactor(channels): dedupe transport and gateway test scaffolds
This commit is contained in:
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user