test: tighten extension shape assertions · openclaw/openclaw@aefba95
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -272,7 +272,8 @@ describe("parseLineDirectives", () => {
|
272 | 272 | expect(flexMessage.contents?.footer?.contents?.length, testCase.name).toBeGreaterThan(0); |
273 | 273 | } |
274 | 274 | if ("expectBodyContents" in testCase && testCase.expectBodyContents) { |
275 | | -expect(flexMessage.contents?.body?.contents, testCase.name).toEqual(expect.any(Array)); |
| 275 | +expect(Array.isArray(flexMessage.contents?.body?.contents), testCase.name).toBe(true); |
| 276 | +expect(flexMessage.contents?.body?.contents?.length, testCase.name).toBeGreaterThan(0); |
276 | 277 | } |
277 | 278 | } |
278 | 279 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -96,7 +96,17 @@ describe("FileBackedMatrixSyncStore", () => {
|
96 | 96 | type: "com.openclaw.test", |
97 | 97 | }, |
98 | 98 | ]); |
99 | | -expect(savedSync?.roomsData.join?.["!room:example.org"]).toEqual(expect.any(Object)); |
| 99 | +expect(savedSync?.roomsData.join?.["!room:example.org"]).toMatchObject({ |
| 100 | +timeline: { |
| 101 | +events: [ |
| 102 | +{ |
| 103 | +event_id: "$message", |
| 104 | +sender: "@user:example.org", |
| 105 | +type: "m.room.message", |
| 106 | +}, |
| 107 | +], |
| 108 | +}, |
| 109 | +}); |
100 | 110 | expect(secondStore.hasSavedSyncFromCleanShutdown()).toBe(false); |
101 | 111 | }); |
102 | 112 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -429,7 +429,7 @@ describe("nostr-profile-http", () => {
|
429 | 429 | const data = expectBadRequestResponse(res); |
430 | 430 | // The schema validation catches non-https URLs before SSRF check |
431 | 431 | expect(data.error).toBe("Validation failed"); |
432 | | -expect(data.details).toEqual(expect.any(Array)); |
| 432 | +expect(Array.isArray(data.details)).toBe(true); |
433 | 433 | expect(data.details).toEqual(expect.arrayContaining([expect.stringContaining("https")])); |
434 | 434 | }); |
435 | 435 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。