test: observe config warning text · openclaw/openclaw@0168521
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -48,7 +48,7 @@ function issueMessages(issues: Array<{ message: string }>): string[] {
|
48 | 48 | } |
49 | 49 | |
50 | 50 | function expectSomeIssueMessageContains(issues: Array<{ message: string }>, text: string): void { |
51 | | -expect(issueMessages(issues).some((message) => message.includes(text))).toBe(true); |
| 51 | +expect(issueMessages(issues).join("\n")).toContain(text); |
52 | 52 | } |
53 | 53 | |
54 | 54 | describe("boolean config validation", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ describe("config io EACCES handling", () => {
|
42 | 42 | expect(snapshot.issues[0].message).toContain("chown"); |
43 | 43 | expect(snapshot.issues[0].message).toContain(configPath); |
44 | 44 | // Should also emit to the logger |
45 | | -expect(errors.some((message) => message.includes("chown"))).toBe(true); |
| 45 | +expect(errors.join("\n")).toContain("chown"); |
46 | 46 | }); |
47 | 47 | |
48 | 48 | it("includes configPath in the chown hint for the correct remediation command", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,11 +105,11 @@ describe("config observe recovery", () => {
|
105 | 105 | } |
106 | 106 | |
107 | 107 | function expectWarnContaining(warn: ReturnType<typeof vi.fn>, expected: string) { |
108 | | -expect(warnMessages(warn).some((message) => message.includes(expected))).toBe(true); |
| 108 | +expect(warnMessages(warn).join("\n")).toContain(expected); |
109 | 109 | } |
110 | 110 | |
111 | 111 | function expectWarnNotContaining(warn: ReturnType<typeof vi.fn>, expected: string) { |
112 | | -expect(warnMessages(warn).some((message) => message.includes(expected))).toBe(false); |
| 112 | +expect(warnMessages(warn).join("\n")).not.toContain(expected); |
113 | 113 | } |
114 | 114 | |
115 | 115 | function observeSuspicious(observe: Record<string, unknown> | undefined): string[] { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。