test: tighten memory search warning assertion · openclaw/openclaw@b97b257
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src/memory
| Original file line number | Diff line number | Diff line change |
|---|
@@ -410,9 +410,14 @@ describe("searchKeyword FTS MATCH fallback", () => {
|
410 | 410 | bm25RankToScore: bm25RankToScore, |
411 | 411 | }); |
412 | 412 | |
413 | | -expect(warnSpy).toHaveBeenCalledWith( |
414 | | -expect.stringContaining("FTS5 MATCH failed, falling back to LIKE"), |
415 | | -); |
| 413 | +expect(warnSpy).toHaveBeenCalledTimes(1); |
| 414 | +const [warning] = warnSpy.mock.calls[0] ?? []; |
| 415 | +expect(typeof warning).toBe("string"); |
| 416 | +expect( |
| 417 | +(warning as string | undefined)?.startsWith( |
| 418 | +"memory search: FTS5 MATCH failed, falling back to LIKE: ", |
| 419 | +), |
| 420 | +).toBe(true); |
416 | 421 | } finally { |
417 | 422 | warnSpy.mockRestore(); |
418 | 423 | db.close(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。