mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:07:41 +00:00
chore: Fix more extension test types, 2/N.
This commit is contained in:
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user