test: tighten diffs artifact assertions · openclaw/openclaw@c7cf34a
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -68,7 +68,7 @@ describe("diffs tool rendered output guards", () => {
|
68 | 68 | }); |
69 | 69 | |
70 | 70 | expect(screenshotter.screenshotHtml).toHaveBeenCalledTimes(1); |
71 | | -expect((result?.details as Record<string, unknown>).filePath).toEqual(expect.any(String)); |
| 71 | +expect((result?.details as Record<string, unknown>).filePath).toMatch(/preview\.png$/); |
72 | 72 | }); |
73 | 73 | }); |
74 | 74 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -190,8 +190,10 @@ describe("diffs tool", () => {
|
190 | 190 | }); |
191 | 191 | |
192 | 192 | expectArtifactOnlyFileResult(screenshotter, result); |
193 | | -expect((result?.details as Record<string, unknown>).artifactId).toEqual(expect.any(String)); |
194 | | -expect((result?.details as Record<string, unknown>).expiresAt).toEqual(expect.any(String)); |
| 193 | +expect(requireString(readDetails(result).artifactId, "artifactId")).toMatch(/^[a-f0-9]{20}$/u); |
| 194 | +expect(requireString(readDetails(result).expiresAt, "expiresAt")).toMatch( |
| 195 | +/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u, |
| 196 | +); |
195 | 197 | }); |
196 | 198 | |
197 | 199 | it("honors ttlSeconds for artifact-only file output", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。