test: clarify memory fallback assertions · openclaw/openclaw@2f001fc
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,13 +29,13 @@ describe("memory vector dedupe", () => {
|
29 | 29 | END; |
30 | 30 | `); |
31 | 31 | |
32 | | -expect(() => |
| 32 | +expect( |
33 | 33 | replaceMemoryVectorRow({ |
34 | | -db: db!, |
| 34 | + db, |
35 | 35 | id: "chunk-1", |
36 | 36 | embedding: [2, 0, 0], |
37 | 37 | }), |
38 | | -).not.toThrow(); |
| 38 | +).toBeUndefined(); |
39 | 39 | |
40 | 40 | const row = db |
41 | 41 | .prepare("SELECT COUNT(*) as c, length(embedding) as bytes FROM chunks_vec WHERE id = ?") |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -268,7 +268,7 @@ describe("memory watcher config", () => {
|
268 | 268 | |
269 | 269 | const watcher = createdWatchers[0]; |
270 | 270 | expect(watcher?.on).toHaveBeenCalledWith("error", expect.any(Function)); |
271 | | -expect(() => watcher?.emit("error", new Error("watcher error: ENOSPC"))).not.toThrow(); |
| 271 | +expect(watcher?.emit("error", new Error("watcher error: ENOSPC"))).toBeUndefined(); |
272 | 272 | expect(memoryLoggerWarn).toHaveBeenCalledWith("memory watcher error: watcher error: ENOSPC"); |
273 | 273 | }); |
274 | 274 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -126,7 +126,7 @@ describe("memory search citations", () => {
|
126 | 126 | }); |
127 | 127 | |
128 | 128 | describe("memory tools", () => { |
129 | | -it("does not throw when memory_search fails (e.g. embeddings 429)", async () => { |
| 129 | +it("returns unavailable details when memory_search fails (e.g. embeddings 429)", async () => { |
130 | 130 | setMemorySearchImpl(async () => { |
131 | 131 | throw new Error("openai embeddings failed: 429 insufficient_quota"); |
132 | 132 | }); |
@@ -142,7 +142,7 @@ describe("memory tools", () => {
|
142 | 142 | }); |
143 | 143 | }); |
144 | 144 | |
145 | | -it("does not throw when memory_get fails", async () => { |
| 145 | +it("returns disabled details when memory_get fails", async () => { |
146 | 146 | setMemoryReadFileImpl(async (_params: MemoryReadParams) => { |
147 | 147 | throw new Error("path required"); |
148 | 148 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -346,7 +346,7 @@ describe("web auto-reply util", () => {
|
346 | 346 | expect(isLikelyWhatsAppCryptoError(err)).toBe(true); |
347 | 347 | }); |
348 | 348 | |
349 | | -it("does not throw on circular objects", () => { |
| 349 | +it("returns false for circular objects", () => { |
350 | 350 | const circular: Record<string, unknown> = {}; |
351 | 351 | circular.self = circular; |
352 | 352 | expect(isLikelyWhatsAppCryptoError(circular)).toBe(false); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。