openclaw-multi-session-plugins/index.test.ts
2026-05-05 11:08:01 +08:00

23 lines
788 B
TypeScript

import type { GatewayRequestHandler, OpenClawPluginApi } from "openclaw/plugin-sdk";
import { describe, expect, it } from "vitest";
import register from "./index.js";
describe("plugin registration", () => {
it("registers the xworkmate artifact export gateway method", () => {
const methods: Array<{ method: string; handler: GatewayRequestHandler }> = [];
const api = {
config: {},
pluginConfig: {},
registerGatewayMethod: (method: string, handler: GatewayRequestHandler) => {
methods.push({ method, handler });
},
} as unknown as OpenClawPluginApi;
register(api);
expect(methods).toHaveLength(1);
expect(methods[0]?.method).toBe("xworkmate.artifacts.export");
expect(typeof methods[0]?.handler).toBe("function");
});
});