test: check task json items · openclaw/openclaw@1461b74
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -85,10 +85,14 @@ describe("tasks JSON commands", () => {
|
85 | 85 | expect(payload.count).toBe(1); |
86 | 86 | expect(payload.runtime).toBe("cli"); |
87 | 87 | expect(payload.status).toBe("running"); |
88 | | -expect(payload.tasks).toHaveLength(1); |
89 | | -expect(payload.tasks[0]?.runtime).toBe("cli"); |
90 | | -expect(payload.tasks[0]?.status).toBe("running"); |
91 | | -expect(payload.tasks[0]?.runId).toBe("run-cli"); |
| 88 | +expect(payload.tasks).toStrictEqual([ |
| 89 | +expect.objectContaining({ |
| 90 | +runtime: "cli", |
| 91 | +status: "running", |
| 92 | +runId: "run-cli", |
| 93 | +task: "Inspect issue backlog", |
| 94 | +}), |
| 95 | +]); |
92 | 96 | }); |
93 | 97 | }); |
94 | 98 | |
@@ -147,10 +151,13 @@ describe("tasks JSON commands", () => {
|
147 | 151 | expect(payload.summary.taskFlows.byCode.stale_waiting).toBe(1); |
148 | 152 | expect(payload.summary.taskFlows.byCode.missing_linked_tasks).toBe(2); |
149 | 153 | expect(payload.summary.combined).toEqual({ total: 5, errors: 3, warnings: 2 }); |
150 | | -expect(payload.findings).toHaveLength(1); |
151 | | -expect(payload.findings[0]?.kind).toBe("task_flow"); |
152 | | -expect(payload.findings[0]?.code).toBe("stale_running"); |
153 | | -expect(payload.findings[0]?.token).toBe(runningFlow.flowId); |
| 154 | +expect(payload.findings).toStrictEqual([ |
| 155 | +expect.objectContaining({ |
| 156 | +kind: "task_flow", |
| 157 | +code: "stale_running", |
| 158 | +token: runningFlow.flowId, |
| 159 | +}), |
| 160 | +]); |
154 | 161 | }); |
155 | 162 | }); |
156 | 163 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。