@@ -44,7 +44,7 @@ describe("DeepInfra provider config", () => {
|
44 | 44 | it("sets DeepInfra alias on the provided model ref", () => { |
45 | 45 | const result = applyDeepInfraProviderConfig(emptyCfg, DEEPINFRA_DEFAULT_MODEL_REF); |
46 | 46 | const agentModel = result.agents?.defaults?.models?.[DEEPINFRA_DEFAULT_MODEL_REF]; |
47 | | -expect(agentModel).toMatchObject({ alias: "DeepInfra" }); |
| 47 | +expect(agentModel).toEqual({ alias: "DeepInfra" }); |
48 | 48 | }); |
49 | 49 | |
50 | 50 | it("attaches the alias to a non-default model ref when provided", () => { |
@@ -115,10 +115,8 @@ describe("DeepInfra provider config", () => {
|
115 | 115 | |
116 | 116 | try { |
117 | 117 | const result = resolveEnvApiKey("deepinfra"); |
118 | | -expect(result).toMatchObject({ |
119 | | -apiKey: "test-deepinfra-key", |
120 | | -source: expect.stringContaining("DEEPINFRA_API_KEY"), |
121 | | -}); |
| 118 | +expect(result?.apiKey).toBe("test-deepinfra-key"); |
| 119 | +expect(result?.source.endsWith("DEEPINFRA_API_KEY")).toBe(true); |
122 | 120 | } finally { |
123 | 121 | envSnapshot.restore(); |
124 | 122 | } |
@@ -153,10 +151,19 @@ describe("DeepInfra provider config", () => {
|
153 | 151 | agentDir, |
154 | 152 | }); |
155 | 153 | |
156 | | -expect(spy).toHaveBeenCalledWith(expect.objectContaining({ provider: "deepinfra" })); |
157 | | -expect(auth.apiKey).toBe("deepinfra-provider-test-key"); |
158 | | -expect(auth.mode).toBe("api-key"); |
159 | | -expect(auth.source).toContain("DEEPINFRA_API_KEY"); |
| 154 | +expect(spy.mock.calls).toEqual([ |
| 155 | +[ |
| 156 | +{ |
| 157 | +provider: "deepinfra", |
| 158 | + agentDir, |
| 159 | +}, |
| 160 | +], |
| 161 | +]); |
| 162 | +expect(auth).toEqual({ |
| 163 | +apiKey: "deepinfra-provider-test-key", |
| 164 | +source: "env: DEEPINFRA_API_KEY", |
| 165 | +mode: "api-key", |
| 166 | +}); |
160 | 167 | } finally { |
161 | 168 | envSnapshot.restore(); |
162 | 169 | } |
|