update 0.6.7 changelog and provider url handling (#1174)

This commit is contained in:
ekko
2026-05-31 10:24:27 +08:00
committed by GitHub
parent e5c5f98fbd
commit 9d1da73434
13 changed files with 134 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest'
import { normalizeCustomProviderBaseUrl } from '@/utils/providerBaseUrl'
describe('normalizeCustomProviderBaseUrl', () => {
it('normalizes api.apikey.fun custom provider URLs to the OpenAI-compatible v1 endpoint', () => {
expect(normalizeCustomProviderBaseUrl('https://api.apikey.fun')).toBe('https://api.apikey.fun/v1')
expect(normalizeCustomProviderBaseUrl('https://api.apikey.fun/')).toBe('https://api.apikey.fun/v1')
expect(normalizeCustomProviderBaseUrl('https://api.apikey.fun/anything')).toBe('https://api.apikey.fun/v1')
expect(normalizeCustomProviderBaseUrl(' https://api.apikey.fun/v2/chat ')).toBe('https://api.apikey.fun/v1')
})
it('leaves unrelated provider URLs unchanged apart from trimming', () => {
expect(normalizeCustomProviderBaseUrl(' https://api.example.com/v1 ')).toBe('https://api.example.com/v1')
expect(normalizeCustomProviderBaseUrl('https://not-api.apikey.fun/v1')).toBe('https://not-api.apikey.fun/v1')
})
})