File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/api/providers/fetchers/__tests__ Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,26 @@ describe("getLiteLLMModels", () => {
1212 jest . clearAllMocks ( )
1313 } )
1414
15+ it ( "handles base URLs with trailing slashes correctly" , async ( ) => {
16+ const mockResponse = {
17+ data : {
18+ data : [ ] ,
19+ } ,
20+ }
21+
22+ mockedAxios . get . mockResolvedValue ( mockResponse )
23+
24+ await getLiteLLMModels ( "test-api-key" , "http://localhost:4000/" )
25+
26+ expect ( mockedAxios . get ) . toHaveBeenCalledWith ( "http://localhost:4000/v1/model/info" , {
27+ headers : {
28+ Authorization : "Bearer test-api-key" ,
29+ "Content-Type" : "application/json" ,
30+ } ,
31+ timeout : 5000 ,
32+ } )
33+ } )
34+
1535 it ( "successfully fetches and formats LiteLLM models" , async ( ) => {
1636 const mockResponse = {
1737 data : {
You can’t perform that action at this time.
0 commit comments