mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
test: add test to verify OpenRouter custom base URL is used correctly
- Added test case to ensure custom base URLs are properly passed to the OpenAI client - This helps prevent regression of issue #6269 where custom base URLs were being ignored Fixes #6269
This commit is contained in:
parent
7a6e852248
commit
8b76585566
1 changed files with 18 additions and 0 deletions
|
|
@ -68,6 +68,24 @@ describe("OpenRouterHandler", () => {
|
|||
})
|
||||
})
|
||||
|
||||
it("uses custom base URL when provided", () => {
|
||||
const customBaseUrl = "https://custom.openrouter.ai/v1"
|
||||
const handler = new OpenRouterHandler({
|
||||
...mockOptions,
|
||||
openRouterBaseUrl: customBaseUrl,
|
||||
})
|
||||
|
||||
expect(OpenAI).toHaveBeenCalledWith({
|
||||
baseURL: customBaseUrl,
|
||||
apiKey: mockOptions.openRouterApiKey,
|
||||
defaultHeaders: {
|
||||
"HTTP-Referer": "https://github.com/RooVetGit/Roo-Cline",
|
||||
"X-Title": "Roo Code",
|
||||
"User-Agent": `RooCode/${Package.version}`,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
describe("fetchModel", () => {
|
||||
it("returns correct model info when options are provided", async () => {
|
||||
const handler = new OpenRouterHandler(mockOptions)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue