test: require command helper results · openclaw/openclaw@de850f4
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -276,8 +276,7 @@ describe("agents delete command", () => {
|
276 | 276 | await agentsDeleteCommand({ id: "ops", force: true, json: true }, runtime); |
277 | 277 | |
278 | 278 | // Workspace should still exist — it was shared |
279 | | -const stat = await fs.stat(sharedWorkspace).catch(() => null); |
280 | | -expect(stat).not.toBeNull(); |
| 279 | +await expect(fs.stat(sharedWorkspace)).resolves.toEqual(expect.any(Object)); |
281 | 280 | |
282 | 281 | // The JSON output should report why the workspace was retained. |
283 | 282 | const jsonOutput = readJsonLogs(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -210,6 +210,8 @@ describe("backup commands", () => {
|
210 | 210 | expect(result.archivePath).toBe( |
211 | 211 | path.join(backupDir, `${buildBackupArchiveRoot(nowMs)}.tar.gz`), |
212 | 212 | ); |
| 213 | +expect(capturedManifest).toEqual(expect.objectContaining({ assets: expect.any(Array) })); |
| 214 | +expect(capturedOnWriteEntry).toEqual(expect.any(Function)); |
213 | 215 | if (capturedManifest === null || capturedOnWriteEntry === null) { |
214 | 216 | throw new Error("Expected backup manifest and archive entry callback"); |
215 | 217 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -115,8 +115,11 @@ describe("detectLinuxSdBackedStateDir", () => {
|
115 | 115 | }, |
116 | 116 | }); |
117 | 117 | |
118 | | -expect(result).not.toBeNull(); |
119 | | -const warning = formatLinuxSdBackedStateDirWarning(stateDir, result!); |
| 118 | +expect(result).toEqual(expect.any(Object)); |
| 119 | +if (result === null) { |
| 120 | +throw new Error("Expected Linux state storage warning details"); |
| 121 | +} |
| 122 | +const warning = formatLinuxSdBackedStateDirWarning(stateDir, result); |
120 | 123 | expect(warning).toContain("device /dev/disk/by-uuid/mmc\\nsource"); |
121 | 124 | expect(warning).toContain("mount /home/pi/mnt\\nspoofed"); |
122 | 125 | expect(warning).not.toContain("device /dev/disk/by-uuid/mmc\nsource"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -656,8 +656,11 @@ describe("legacy migrate heartbeat config", () => {
|
656 | 656 | }); |
657 | 657 | |
658 | 658 | expect(res.changes).toContain("Removed empty top-level heartbeat."); |
659 | | -expect(res.config).not.toBeNull(); |
660 | | -expect((res.config as { heartbeat?: unknown } | null)?.heartbeat).toBeUndefined(); |
| 659 | +expect(res.config).toEqual(expect.any(Object)); |
| 660 | +if (res.config === null) { |
| 661 | +throw new Error("Expected migrated config"); |
| 662 | +} |
| 663 | +expect((res.config as { heartbeat?: unknown }).heartbeat).toBeUndefined(); |
661 | 664 | }); |
662 | 665 | }); |
663 | 666 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。