test: tighten core flow config assertions · openclaw/openclaw@fa15090
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1328,7 +1328,9 @@ describe("config io write", () => {
|
1328 | 1328 | expect(postWriteSnapshot.valid).toBe(true); |
1329 | 1329 | expect(observedSources).toEqual([postWriteSnapshot.sourceConfig]); |
1330 | 1330 | expect(getRuntimeConfigSourceSnapshot()).toEqual(postWriteSnapshot.sourceConfig); |
1331 | | -expect(postWriteSnapshot.sourceConfig.meta?.lastTouchedAt).toEqual(expect.any(String)); |
| 1331 | +expect(postWriteSnapshot.sourceConfig.meta?.lastTouchedAt).toMatch( |
| 1332 | +/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u, |
| 1333 | +); |
1332 | 1334 | expect(postWriteSnapshot.sourceConfig.plugins?.entries?.demo?.config).toEqual({}); |
1333 | 1335 | } finally { |
1334 | 1336 | unsubscribe(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,7 @@ describe("cron service ops regressions", () => {
|
55 | 55 | }; |
56 | 56 | |
57 | 57 | await expect(start(state)).resolves.toBeUndefined(); |
58 | | -expect(state.store.jobs[0]?.state).toEqual(expect.any(Object)); |
| 58 | +expect(state.store.jobs[0]?.state).toMatchObject({ nextRunAtMs: scheduledAt }); |
59 | 59 | }); |
60 | 60 | |
61 | 61 | it("skips forced manual runs while a timer-triggered run is in progress", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -289,7 +289,9 @@ describe("task-executor", () => {
|
289 | 289 | deliveryStatus: "pending", |
290 | 290 | }); |
291 | 291 | |
292 | | -expect(created.parentFlowId).toEqual(expect.any(String)); |
| 292 | +expect(created.parentFlowId).toMatch( |
| 293 | +/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u, |
| 294 | +); |
293 | 295 | expect(getTaskFlowById(created.parentFlowId!)).toMatchObject({ |
294 | 296 | flowId: created.parentFlowId, |
295 | 297 | ownerKey: "agent:main:main", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。