test: tighten mantle provider assertions · openclaw/openclaw@504000f
shakkernerd
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -398,11 +398,12 @@ describe("bedrock mantle discovery", () => {
|
398 | 398 | fetchFn: mockFetch as unknown as typeof fetch, |
399 | 399 | }); |
400 | 400 | |
401 | | -expect(provider).not.toBeNull(); |
402 | | -expect(provider?.baseUrl).toBe("https://bedrock-mantle.us-east-1.api.aws/v1"); |
403 | | -expect(provider?.api).toBe("openai-completions"); |
404 | | -expect(provider?.auth).toBe("api-key"); |
405 | | -expect(provider?.apiKey).toBe("env:AWS_BEARER_TOKEN_BEDROCK"); |
| 401 | +expect(provider).toMatchObject({ |
| 402 | +baseUrl: "https://bedrock-mantle.us-east-1.api.aws/v1", |
| 403 | +api: "openai-completions", |
| 404 | +auth: "api-key", |
| 405 | +apiKey: "env:AWS_BEARER_TOKEN_BEDROCK", |
| 406 | +}); |
406 | 407 | expect(provider?.models).toHaveLength(2); |
407 | 408 | expect( |
408 | 409 | provider?.models?.find((model) => model.id === "anthropic.claude-opus-4-7"), |
@@ -447,8 +448,7 @@ describe("bedrock mantle discovery", () => {
|
447 | 448 | tokenProviderFactory, |
448 | 449 | }); |
449 | 450 | |
450 | | -expect(provider).not.toBeNull(); |
451 | | -expect(provider?.apiKey).toBe(MANTLE_IAM_TOKEN_MARKER); |
| 451 | +expect(provider).toMatchObject({ apiKey: MANTLE_IAM_TOKEN_MARKER }); |
452 | 452 | expect(tokenProvider).toHaveBeenCalledTimes(1); |
453 | 453 | expect(mockFetch).toHaveBeenCalledWith( |
454 | 454 | "https://bedrock-mantle.us-east-1.api.aws/v1/models", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。