test: count cli command calls · openclaw/openclaw@e35bc01
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -211,7 +211,7 @@ describe("daemon-cli coverage", () => {
|
211 | 211 | "ws://127.0.0.1:18789", |
212 | 212 | ); |
213 | 213 | expect(findExtraGatewayServices).not.toHaveBeenCalled(); |
214 | | -expect(inspectPortUsage).toHaveBeenCalled(); |
| 214 | +expect(inspectPortUsage).toHaveBeenCalledTimes(1); |
215 | 215 | }); |
216 | 216 | |
217 | 217 | it("derives probe URL from service args + env (json)", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -304,7 +304,7 @@ describe("runDaemonRestart health checks", () => {
|
304 | 304 | await runDaemonRestart({ json: true, force: true }); |
305 | 305 | |
306 | 306 | expect(callGatewayCli).not.toHaveBeenCalled(); |
307 | | -expect(runServiceRestart).toHaveBeenCalled(); |
| 307 | +expect(runServiceRestart).toHaveBeenCalledTimes(1); |
308 | 308 | }); |
309 | 309 | |
310 | 310 | it("forwards --safe --skip-deferral as skipDeferral: true on the RPC", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,7 +93,7 @@ describe("gateway --force helpers", () => {
|
93 | 93 | |
94 | 94 | const killed = forceFreePort(18789); |
95 | 95 | |
96 | | -expect(execFileSync).toHaveBeenCalled(); |
| 96 | +expect(execFileSync).toHaveBeenCalledTimes(1); |
97 | 97 | expect(killMock).toHaveBeenCalledTimes(2); |
98 | 98 | expect(killMock).toHaveBeenCalledWith(42, "SIGTERM"); |
99 | 99 | expect(killMock).toHaveBeenCalledWith(99, "SIGTERM"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -274,7 +274,7 @@ describe("runMessageAction", () => {
|
274 | 274 | scope: "configured-channels", |
275 | 275 | onlyChannelIds: ["telegram"], |
276 | 276 | }); |
277 | | -expect(messageCommandMock).toHaveBeenCalled(); |
| 277 | +expect(messageCommandMock).toHaveBeenCalledTimes(1); |
278 | 278 | }); |
279 | 279 | |
280 | 280 | it("loads configured channel plugins for mixed broadcast target prefixes", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。