test(agents): inline auth profile ordering fixtures · openclaw/openclaw@366ef93
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,10 +4,7 @@
|
4 | 4 | * round-robin ordering semantics. |
5 | 5 | */ |
6 | 6 | import { describe, expect, it, vi } from "vitest"; |
7 | | -import { |
8 | | -ANTHROPIC_CFG, |
9 | | -ANTHROPIC_STORE, |
10 | | -} from "./auth-profiles.resolve-auth-profile-order.fixtures.js"; |
| 7 | +import type { OpenClawConfig } from "../config/types.openclaw.js"; |
11 | 8 | import { resolveAuthProfileOrder } from "./auth-profiles/order.js"; |
12 | 9 | import type { AuthProfileStore } from "./auth-profiles/types.js"; |
13 | 10 | |
@@ -42,6 +39,31 @@ function makeApiKeyProfilesByProviderProvider(
|
42 | 39 | ); |
43 | 40 | } |
44 | 41 | |
| 42 | +const ANTHROPIC_STORE = { |
| 43 | +version: 1, |
| 44 | +profiles: { |
| 45 | +"anthropic:default": { |
| 46 | +type: "api_key", |
| 47 | +provider: "anthropic", |
| 48 | +key: "sk-default", |
| 49 | +}, |
| 50 | +"anthropic:work": { |
| 51 | +type: "api_key", |
| 52 | +provider: "anthropic", |
| 53 | +key: "sk-work", |
| 54 | +}, |
| 55 | +}, |
| 56 | +} satisfies AuthProfileStore; |
| 57 | + |
| 58 | +const ANTHROPIC_CFG = { |
| 59 | +auth: { |
| 60 | +profiles: { |
| 61 | +"anthropic:default": { provider: "anthropic", mode: "api_key" }, |
| 62 | +"anthropic:work": { provider: "anthropic", mode: "api_key" }, |
| 63 | +}, |
| 64 | +}, |
| 65 | +} satisfies OpenClawConfig; |
| 66 | + |
45 | 67 | describe("resolveAuthProfileOrder", () => { |
46 | 68 | const store = ANTHROPIC_STORE; |
47 | 69 | const cfg = ANTHROPIC_CFG; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。