test: tighten backup verify wrapper assertions · openclaw/openclaw@70ac5f5
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -56,9 +56,19 @@ describe("backupCreateCommand verify wrapper", () => {
|
56 | 56 | const result = await backupCreateCommand(runtime, { verify: true }); |
57 | 57 | |
58 | 58 | expect(result.verified).toBe(true); |
59 | | -expect(backupVerifyCommandMock).toHaveBeenCalledWith( |
60 | | -expect.objectContaining({ log: expect.any(Function) }), |
61 | | -expect.objectContaining({ archive: "/tmp/openclaw-backup.tar.gz", json: false }), |
62 | | -); |
| 59 | +expect(backupVerifyCommandMock).toHaveBeenCalledOnce(); |
| 60 | +const [verifyRuntime, verifyOptions] = backupVerifyCommandMock.mock.calls[0] ?? []; |
| 61 | +expect(verifyOptions).toStrictEqual({ |
| 62 | +archive: "/tmp/openclaw-backup.tar.gz", |
| 63 | +json: false, |
| 64 | +}); |
| 65 | +const verifyLog = verifyRuntime?.log; |
| 66 | +expect(verifyRuntime).toStrictEqual({ |
| 67 | +log: verifyLog, |
| 68 | +error: runtime.error, |
| 69 | +exit: runtime.exit, |
| 70 | +}); |
| 71 | +expect(verifyLog).not.toBe(runtime.log); |
| 72 | +expect(typeof verifyLog).toBe("function"); |
63 | 73 | }); |
64 | 74 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。