Browse Source

test: fix hook ordering assertion in memory retrieval test

Hook selection order is non-deterministic; use sorted comparison.
Ma 7 months ago
parent
commit
c6829f53da
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/core/src/__tests__/memory-retrieval.test.ts

+ 2 - 2
packages/core/src/__tests__/memory-retrieval.test.ts

@@ -992,9 +992,9 @@ describe("retrieveMemorySelection", () => {
       mustKeep: ["匿名来电必须留在开篇。"],
       mustKeep: ["匿名来电必须留在开篇。"],
     });
     });
 
 
-    expect(result.hooks.map((hook) => hook.hookId)).toEqual([
-      "opening-call",
+    expect(result.hooks.map((hook) => hook.hookId).sort()).toEqual([
       "nearby-ledger",
       "nearby-ledger",
+      "opening-call",
     ]);
     ]);
   });
   });