test: tighten plugin http route assertions · openclaw/openclaw@190d1ce
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -43,17 +43,19 @@ function expectRegisteredRouteShape(
|
43 | 43 | handler?: unknown; |
44 | 44 | auth: "plugin" | "gateway"; |
45 | 45 | match?: "exact" | "prefix"; |
| 46 | +pluginId?: string; |
| 47 | +source?: string; |
46 | 48 | }, |
47 | 49 | ) { |
48 | 50 | expect(registry.httpRoutes).toHaveLength(1); |
49 | | -expect(registry.httpRoutes[0]).toEqual( |
50 | | -expect.objectContaining({ |
51 | | - path: params.path, |
52 | | - auth: params.auth, |
53 | | - ...(params.match ? { match: params.match } : {}), |
54 | | - ...(params.handler ? { handler: params.handler } : {}), |
55 | | -}), |
56 | | -); |
| 51 | +expect(registry.httpRoutes[0]).toEqual({ |
| 52 | +path: params.path, |
| 53 | +handler: params.handler ?? registry.httpRoutes[0]?.handler, |
| 54 | +auth: params.auth, |
| 55 | +match: params.match ?? "exact", |
| 56 | +pluginId: params.pluginId, |
| 57 | +source: params.source, |
| 58 | +}); |
57 | 59 | } |
58 | 60 | |
59 | 61 | function createLoggedRouteHarness() { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。