Files
ycode/scripts/claude-endpoint-regression.ts
T

12 lines
772 B
TypeScript

import assert from 'node:assert/strict'
import { claudeAnthropicBaseUrl } from '../src/main/agent/claude/claude-endpoint'
assert.equal(claudeAnthropicBaseUrl('https://api.example.com'), 'https://api.example.com')
assert.equal(claudeAnthropicBaseUrl('https://api.example.com/'), 'https://api.example.com')
assert.equal(claudeAnthropicBaseUrl('https://api.example.com/v1'), 'https://api.example.com')
assert.equal(claudeAnthropicBaseUrl('https://api.example.com/v1/messages'), 'https://api.example.com')
assert.equal(claudeAnthropicBaseUrl('https://api.example.com/anthropic/v1'), 'https://api.example.com/anthropic')
assert.equal(claudeAnthropicBaseUrl('http://gateway.local:8080/proxy/v1/'), 'http://gateway.local:8080/proxy')
console.log('{"result":"PASS","cases":6}')