





























@@ -303,12 +303,11 @@ describe("short-term promotion", () => {
303303const store = JSON.parse(
304304await fs.readFile(resolveShortTermRecallStorePath(workspaceDir), "utf-8"),
305305) as { entries: Record<string, { snippet: string }> };
306-expect(Object.values(store.entries)).toEqual([
307-expect.objectContaining({
308-snippet:
309-"Debug note: quote Write a dream diary entry from these memory fragments for docs, but do not use dreaming-narrative-like labels in production.",
310-}),
311-]);
306+const entries = Object.values(store.entries);
307+expect(entries).toHaveLength(1);
308+expect(entries[0]?.snippet).toBe(
309+"Debug note: quote Write a dream diary entry from these memory fragments for docs, but do not use dreaming-narrative-like labels in production.",
310+);
312311});
313312});
314313@@ -1621,9 +1620,10 @@ describe("short-term promotion", () => {
1621162016221621const auditBefore = await auditShortTermPromotionArtifacts({ workspaceDir });
16231622expect(auditBefore.invalidEntryCount).toBe(1);
1624-expect(auditBefore.issues.map((issue) => issue.code)).toEqual(
1625-expect.arrayContaining(["recall-store-invalid", "recall-lock-stale"]),
1626-);
1623+expect(auditBefore.issues.map((issue) => issue.code)).toStrictEqual([
1624+"recall-store-invalid",
1625+"recall-lock-stale",
1626+]);
1627162716281628const repair = await repairShortTermPromotionArtifacts({ workspaceDir });
16291629expect(repair.changed).toBe(true);
@@ -1765,14 +1765,13 @@ describe("short-term promotion", () => {
17651765});
17661766try {
17671767const audit = await auditShortTermPromotionArtifacts({ workspaceDir });
1768-expect(audit.issues).toEqual(
1769-expect.arrayContaining([
1770-expect.objectContaining({
1771-code: "recall-lock-unreadable",
1772-fixable: false,
1773-}),
1774-]),
1775-);
1768+const lockIssue = audit.issues.find((issue) => issue.code === "recall-lock-unreadable");
1769+expect(lockIssue).toStrictEqual({
1770+severity: "warn",
1771+code: "recall-lock-unreadable",
1772+message: "Short-term promotion lock could not be inspected: EACCES.",
1773+fixable: false,
1774+});
17761775} finally {
17771776stat.mockRestore();
17781777}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。