test: verify agent runtime values · openclaw/openclaw@2249af2
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -244,13 +244,13 @@ describe("cli credentials", () => {
|
244 | 244 | expectFields(first, { |
245 | 245 | type: "oauth", |
246 | 246 | provider: "anthropic", |
247 | | -access: expect.stringMatching(/^token-/), |
| 247 | +access: "token-1735689600000", |
248 | 248 | refresh: "cached-refresh", |
249 | 249 | }); |
250 | 250 | expectFields(second, { |
251 | 251 | type: "oauth", |
252 | 252 | provider: "anthropic", |
253 | | -access: expect.stringMatching(/^token-/), |
| 253 | +access: expectSameObject ? "token-1735689600000" : "token-1735690500001", |
254 | 254 | refresh: "cached-refresh", |
255 | 255 | }); |
256 | 256 | if (expectSameObject) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -768,9 +768,11 @@ describe("runContextEngineMaintenance", () => {
|
768 | 768 | status: "cancelled", |
769 | 769 | notifyPolicy: "silent", |
770 | 770 | }); |
771 | | -expect(tasks.map((task) => task.runId)).toContainEqual( |
772 | | -expect.stringMatching(/^turn-maint:/), |
773 | | -); |
| 771 | +expect( |
| 772 | +tasks.some( |
| 773 | +(task) => typeof task.runId === "string" && task.runId.startsWith("turn-maint:"), |
| 774 | +), |
| 775 | +).toBe(true); |
774 | 776 | } finally { |
775 | 777 | vi.useRealTimers(); |
776 | 778 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -250,10 +250,12 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {
|
250 | 250 | }); |
251 | 251 | |
252 | 252 | expect(mockedEnsureAuthProfileStore).not.toHaveBeenCalled(); |
253 | | -expect(mockedEnsureAuthProfileStoreWithoutExternalProfiles).toHaveBeenCalledWith( |
254 | | -expect.stringMatching(/[/\\]\.openclaw[/\\]agents[/\\]main[/\\]agent$/), |
255 | | -{ allowKeychainPrompt: false }, |
256 | | -); |
| 253 | +const authStoreCall = mockedEnsureAuthProfileStoreWithoutExternalProfiles.mock.calls[0]; |
| 254 | +expect(typeof authStoreCall?.[0]).toBe("string"); |
| 255 | +expect( |
| 256 | +String(authStoreCall?.[0]).replaceAll("\\", "/").endsWith("/.openclaw/agents/main/agent"), |
| 257 | +).toBe(true); |
| 258 | +expect(authStoreCall?.[1]).toEqual({ allowKeychainPrompt: false }); |
257 | 259 | }); |
258 | 260 | |
259 | 261 | it("forwards optional attempt params and the runtime plan into one attempt call", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -501,7 +501,7 @@ describe("ensureSandboxBrowser create args", () => {
|
501 | 501 | ).rejects.toThrow("hung container has been forcefully removed"); |
502 | 502 | |
503 | 503 | expect(dockerMocks.execDocker).toHaveBeenCalledWith( |
504 | | -["rm", "-f", expect.stringMatching(/^openclaw-sbx-browser-session-test-/)], |
| 504 | +["rm", "-f", "openclaw-sbx-browser-session-test-0661d10a"], |
505 | 505 | { allowFailure: true }, |
506 | 506 | ); |
507 | 507 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。