chore: Fix more extension test types, 2/N.

This commit is contained in:
cpojer
2026-02-17 10:12:34 +09:00
parent 72f00df95a
commit a741985574
7 changed files with 63 additions and 23 deletions

View File

@@ -1,8 +1,16 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
import { describe, expect, it } from "vitest";
import { msteamsPlugin } from "./channel.js";
describe("msteams directory", () => {
const runtimeEnv: RuntimeEnv = {
log: () => {},
error: () => {},
exit: (code: number): never => {
throw new Error(`exit ${code}`);
},
};
it("lists peers and groups from config", async () => {
const cfg = {
channels: {
@@ -26,7 +34,12 @@ describe("msteams directory", () => {
expect(msteamsPlugin.directory?.listGroups).toBeTruthy();
await expect(
msteamsPlugin.directory!.listPeers({ cfg, query: undefined, limit: undefined }),
msteamsPlugin.directory!.listPeers!({
cfg,
query: undefined,
limit: undefined,
runtime: runtimeEnv,
}),
).resolves.toEqual(
expect.arrayContaining([
{ kind: "user", id: "user:alice" },
@@ -37,7 +50,12 @@ describe("msteams directory", () => {
);
await expect(
msteamsPlugin.directory!.listGroups({ cfg, query: undefined, limit: undefined }),
msteamsPlugin.directory!.listGroups!({
cfg,
query: undefined,
limit: undefined,
runtime: runtimeEnv,
}),
).resolves.toEqual(
expect.arrayContaining([
{ kind: "group", id: "conversation:chan1" },