| 1 | import { describe, vi } from "vitest"; |
| 2 | import { createAdapterTests } from "./adapter-test-utils.js"; |
| 3 | |
| 4 | // Mock the fetch package (not needed for OpenAI but required by the shared test utils) |
| 5 | vi.mock("@continuedev/fetch", async () => { |
| 6 | const actual = await vi.importActual("@continuedev/fetch"); |
| 7 | return { |
| 8 | ...actual, |
| 9 | fetchwithRequestOptions: vi.fn(), |
| 10 | }; |
| 11 | }); |
| 12 | |
| 13 | describe("OpenAI Adapter Tests", () => { |
| 14 | createAdapterTests({ |
| 15 | providerName: "openai", |
| 16 | config: { |
| 17 | provider: "openai", |
| 18 | apiKey: "test-api-key", |
| 19 | apiBase: "https://api.openai.com/v1/", |
| 20 | }, |
| 21 | expectedApiBase: "https://api.openai.com/v1/", |
| 22 | customHeaders: { |
| 23 | authorization: "Bearer test-api-key", |
| 24 | "content-type": "application/json", |
| 25 | accept: "application/json", |
| 26 | }, |
| 27 | }); |
| 28 | }); |