test: avoid status module reload · openclaw/openclaw@8437ccf
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,8 @@ vi.mock("../plugins/commands.js", () => ({
|
34 | 34 | |
35 | 35 | afterEach(() => { |
36 | 36 | vi.restoreAllMocks(); |
| 37 | +listPluginCommands.mockReset(); |
| 38 | +listPluginCommands.mockImplementation(() => []); |
37 | 39 | MODEL_CONTEXT_TOKEN_CACHE.clear(); |
38 | 40 | }); |
39 | 41 | |
@@ -2131,17 +2133,15 @@ describe("buildCommandsMessagePaginated", () => {
|
2131 | 2133 | ]; |
2132 | 2134 | listPluginCommands.mockImplementation(() => pluginCommands); |
2133 | 2135 | expect(listPluginCommands()).toEqual(pluginCommands); |
2134 | | -vi.resetModules(); |
2135 | | -const { buildCommandsMessagePaginated: buildPaginatedCommands } = await import("./status.js"); |
2136 | | -const firstPage = buildPaginatedCommands( |
| 2136 | +const firstPage = buildCommandsMessagePaginated( |
2137 | 2137 | { |
2138 | 2138 | commands: { config: false, debug: false }, |
2139 | 2139 | } as unknown as OpenClawConfig, |
2140 | 2140 | undefined, |
2141 | 2141 | { surface: "telegram", page: 1, forcePaginatedList: true }, |
2142 | 2142 | ); |
2143 | 2143 | const pages = Array.from({ length: firstPage.totalPages }, (_, index) => |
2144 | | -buildPaginatedCommands( |
| 2144 | +buildCommandsMessagePaginated( |
2145 | 2145 | { |
2146 | 2146 | commands: { config: false, debug: false }, |
2147 | 2147 | } as unknown as OpenClawConfig, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。