test: tighten acpx memory assertions · openclaw/openclaw@5b6f4d6
steipete
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -119,13 +119,10 @@ describe("patched claude-agent-acp completion", () => {
|
119 | 119 | expect(resolved).toBe(false); |
120 | 120 | |
121 | 121 | query.push(makeIdleMessage()); |
122 | | -await expect(promptPromise).resolves.toMatchObject({ |
123 | | -stopReason: "end_turn", |
124 | | -usage: { |
125 | | -inputTokens: 1, |
126 | | -outputTokens: 1, |
127 | | -}, |
128 | | -}); |
| 122 | +const result = await promptPromise; |
| 123 | +expect(result.stopReason).toBe("end_turn"); |
| 124 | +expect(result.usage?.inputTokens).toBe(1); |
| 125 | +expect(result.usage?.outputTokens).toBe(1); |
129 | 126 | }); |
130 | 127 | |
131 | 128 | it("does not resolve a prompt after a task-notification result goes idle", async () => { |
@@ -182,12 +179,9 @@ describe("patched claude-agent-acp completion", () => {
|
182 | 179 | expect(resolved).toBe(false); |
183 | 180 | |
184 | 181 | query.push(makeIdleMessage()); |
185 | | -await expect(promptPromise).resolves.toMatchObject({ |
186 | | -stopReason: "end_turn", |
187 | | -usage: { |
188 | | -inputTokens: 2, |
189 | | -outputTokens: 2, |
190 | | -}, |
191 | | -}); |
| 182 | +const result = await promptPromise; |
| 183 | +expect(result.stopReason).toBe("end_turn"); |
| 184 | +expect(result.usage?.inputTokens).toBe(2); |
| 185 | +expect(result.usage?.outputTokens).toBe(2); |
192 | 186 | }); |
193 | 187 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -255,7 +255,7 @@ describe("runCodexAppServerSideQuestion", () => {
|
255 | 255 | const forkCall = client.request.mock.calls[0]; |
256 | 256 | expect(forkCall?.[0]).toBe("thread/fork"); |
257 | 257 | const forkParams = forkCall?.[1] as Record<string, unknown> | undefined; |
258 | | -expect(Object.keys(forkParams ?? {}).sort()).toEqual([ |
| 258 | +expect(Object.keys(forkParams ?? {}).toSorted()).toEqual([ |
259 | 259 | "approvalPolicy", |
260 | 260 | "approvalsReviewer", |
261 | 261 | "config", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -449,11 +449,9 @@ describe("memory index", () => {
|
449 | 449 | managersForCleanup.add(second); |
450 | 450 | |
451 | 451 | const cachedBeforeProbe = second.getCachedEmbeddingAvailability?.(); |
452 | | -expect(cachedBeforeProbe).toMatchObject({ |
453 | | -ok: true, |
454 | | -checked: true, |
455 | | -cached: true, |
456 | | -}); |
| 452 | +expect(cachedBeforeProbe?.ok).toBe(true); |
| 453 | +expect(cachedBeforeProbe?.checked).toBe(true); |
| 454 | +expect(cachedBeforeProbe?.cached).toBe(true); |
457 | 455 | expect(cachedBeforeProbe?.checkedAtMs).toBeTypeOf("number"); |
458 | 456 | expect(cachedBeforeProbe?.cacheExpiresAtMs).toBeTypeOf("number"); |
459 | 457 | if ( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。