test: strengthen plugin registration assertions · openclaw/openclaw@f0af649
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,7 +84,8 @@ describe("codex plugin", () => {
|
84 | 84 | }; |
85 | 85 | delete (api as { onConversationBindingResolved?: unknown }).onConversationBindingResolved; |
86 | 86 | |
87 | | -expect(() => plugin.register(api)).not.toThrow(); |
| 87 | +plugin.register(api); |
| 88 | +expect(api.registerProvider).toHaveBeenCalledWith(expect.objectContaining({ id: "codex" })); |
88 | 89 | }); |
89 | 90 | |
90 | 91 | it("only claims the codex provider by default", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -75,7 +75,8 @@ describe("matrix plugin", () => {
|
75 | 75 | if (!entry.setChannelRuntime) { |
76 | 76 | throw new Error("expected Matrix runtime setter"); |
77 | 77 | } |
78 | | -expect(() => entry.setChannelRuntime?.({ marker: "runtime" } as never)).not.toThrow(); |
| 78 | +entry.setChannelRuntime({ marker: "runtime" } as never); |
| 79 | +expect(runtimeMocks.setMatrixRuntime).not.toHaveBeenCalled(); |
79 | 80 | }); |
80 | 81 | |
81 | 82 | it("wires CLI metadata through the bundled entry", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ describe("registerSlackPluginHttpRoutes", () => {
|
42 | 42 | }; |
43 | 43 | const api = createApi(cfg, registerHttpRoute); |
44 | 44 | |
45 | | -expect(() => registerSlackPluginHttpRoutes(api)).not.toThrow(); |
| 45 | +registerSlackPluginHttpRoutes(api); |
46 | 46 | |
47 | 47 | const paths = registerHttpRoute.mock.calls |
48 | 48 | .map((call) => (call[0] as { path: string }).path) |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。