mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
22 lines
700 B
TypeScript
22 lines
700 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { isAzureOpenAIHostname } from '../src/integrations/openai-chat-token-params.js';
|
|
|
|
describe('isAzureOpenAIHostname', () => {
|
|
it.each([
|
|
'resource.openai.azure.com',
|
|
'resource.services.ai.azure.com',
|
|
'resource.cognitiveservices.azure.com',
|
|
'RESOURCE.SERVICES.AI.AZURE.COM.',
|
|
])('recognizes Azure OpenAI-compatible host %s', (hostname) => {
|
|
expect(isAzureOpenAIHostname(hostname)).toBe(true);
|
|
});
|
|
|
|
it.each([
|
|
'api.openai.com',
|
|
'services.ai.azure.com.evil.example',
|
|
'notservices.ai.azure.com',
|
|
])('rejects non-Azure host %s', (hostname) => {
|
|
expect(isAzureOpenAIHostname(hostname)).toBe(false);
|
|
});
|
|
});
|