@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
24 lines (20 loc) • 1.02 kB
text/typescript
import { describe, expect, it } from 'vitest';
import { API_ENDPOINTS } from '../_url';
describe('API_ENDPOINTS', () => {
it('should return correct basePath URLs', () => {
expect(API_ENDPOINTS.oauth).toBe('/api/auth');
expect(API_ENDPOINTS.proxy).toBe('/webapi/proxy');
expect(API_ENDPOINTS.gateway).toBe('/webapi/plugin/gateway');
expect(API_ENDPOINTS.trace).toBe('/webapi/trace');
expect(API_ENDPOINTS.stt).toBe('/webapi/stt/openai');
expect(API_ENDPOINTS.tts).toBe('/webapi/tts/openai');
expect(API_ENDPOINTS.edge).toBe('/webapi/tts/edge');
expect(API_ENDPOINTS.microsoft).toBe('/webapi/tts/microsoft');
});
it('should return correct dynamic URLs', () => {
expect(API_ENDPOINTS.chat('openai')).toBe('/webapi/chat/openai');
expect(API_ENDPOINTS.models('anthropic')).toBe('/webapi/models/anthropic');
expect(API_ENDPOINTS.modelPull('azure')).toBe('/webapi/models/azure/pull');
expect(API_ENDPOINTS.images('dalle')).toBe('/webapi/text-to-image/dalle');
});
});