mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 19:11:33 +00:00
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
/** Shared fixtures for secrets runtime matrix tests. */
|
|
import { vi } from "vitest";
|
|
import { loadChannelSecretContractApi } from "./channel-contract-api.js";
|
|
|
|
/** Test-only bootstrap registry mock for Matrix secret surface tests. */
|
|
const matrixSecrets = loadChannelSecretContractApi({ channelId: "matrix", config: {} });
|
|
if (!matrixSecrets?.collectRuntimeConfigAssignments) {
|
|
throw new Error("Missing Matrix secret contract api");
|
|
}
|
|
const matrixAssignments = matrixSecrets.collectRuntimeConfigAssignments;
|
|
|
|
// Use the real bundled Matrix secret contract while avoiding plugin bootstrap.
|
|
vi.mock("../channels/plugins/bootstrap-registry.js", () => ({
|
|
getBootstrapChannelPlugin: (id: string) =>
|
|
id === "matrix"
|
|
? {
|
|
secrets: {
|
|
collectRuntimeConfigAssignments: matrixAssignments,
|
|
},
|
|
}
|
|
: undefined,
|
|
getBootstrapChannelSecrets: (id: string) =>
|
|
id === "matrix"
|
|
? {
|
|
collectRuntimeConfigAssignments: matrixAssignments,
|
|
}
|
|
: undefined,
|
|
}));
|