@@ -15,13 +15,13 @@ import { buildGatewayEnv, type DisableEvent, IDS } from './worker'
1515
1616describe ( 'invalid request' , ( ) => {
1717 test ( '401 on no auth header' , async ( { gateway } ) => {
18- const response = await gateway . fetch ( 'https://example.com/openai /gpt-5' )
18+ const response = await gateway . fetch ( 'https://example.com/chat /gpt-5' )
1919 const text = await response . text ( )
2020 expect ( response . status , `got ${ response . status } response: ${ text } ` ) . toBe ( 401 )
2121 expect ( text ) . toMatchInlineSnapshot ( `"Unauthorized - Missing Authorization Header"` )
2222 } )
2323 test ( '401 on unknown auth header' , async ( { gateway } ) => {
24- const response = await gateway . fetch ( 'https://example.com/openai /gpt-5' , {
24+ const response = await gateway . fetch ( 'https://example.com/chat /gpt-5' , {
2525 headers : { Authorization : 'unknown-token' } ,
2626 } )
2727 const text = await response . text ( )
@@ -35,7 +35,7 @@ describe('invalid request', () => {
3535 const text = await response . text ( )
3636 expect ( response . status , `got ${ response . status } response: ${ text } ` ) . toBe ( 400 )
3737 expect ( text ) . toMatchInlineSnapshot (
38- `"Invalid provider 'wrong', should be one of groq, openai, google-vertex , anthropic, bedrock "` ,
38+ `"Invalid API type 'wrong', should be one of chat, responses, converse , anthropic, gemini, groq, test "` ,
3939 )
4040 } )
4141} )
@@ -66,7 +66,7 @@ describe('key status', () => {
6666 test ( 'should block request if key is disabled' , async ( { gateway } ) => {
6767 const { fetch } = gateway
6868
69- const response = await fetch ( 'https://example.com/openai /xxx' , { headers : { Authorization : 'disabled' } } )
69+ const response = await fetch ( 'https://example.com/chat /xxx' , { headers : { Authorization : 'disabled' } } )
7070 const text = await response . text ( )
7171 expect ( response . status , `got response: ${ response . status } ${ text } ` ) . toBe ( 403 )
7272 expect ( text ) . toMatchInlineSnapshot ( `"Unauthorized - Key disabled"` )
@@ -132,7 +132,7 @@ describe('key status', () => {
132132 expect ( Math . abs ( keyStatusQuery . results [ 0 ] ! . expiresAtDiff - disableEvents [ 0 ] ! . expirationTtl ! ) ) . toBeLessThan ( 2 )
133133
134134 {
135- const response = await fetch ( 'https://example.com/openai /xxx' , { headers : { Authorization : 'tiny-limit' } } )
135+ const response = await fetch ( 'https://example.com/chat /xxx' , { headers : { Authorization : 'tiny-limit' } } )
136136 const text = await response . text ( )
137137 expect ( response . status , `got ${ response . status } response: ${ text } ` ) . toBe ( 403 )
138138 expect ( text ) . toMatchInlineSnapshot ( `"Unauthorized - Key limit-exceeded"` )
@@ -215,7 +215,7 @@ describe('custom proxyPrefixLength', () => {
215215 const disableEvents : DisableEvent [ ] = [ ]
216216 const mockFetch = mockFetchFactory ( disableEvents )
217217
218- const client = new OpenAI ( { apiKey : 'healthy' , baseURL : 'https://example.com/proxy/openai ' , fetch : mockFetch } )
218+ const client = new OpenAI ( { apiKey : 'healthy' , baseURL : 'https://example.com/proxy/chat ' , fetch : mockFetch } )
219219
220220 const completion = await client . chat . completions . create ( {
221221 model : 'gpt-5' ,
@@ -249,7 +249,7 @@ describe('custom middleware', () => {
249249 ) [ ] = [ ]
250250
251251 const ctx = createExecutionContext ( )
252- const request = new Request < unknown , IncomingRequestCfProperties > ( 'https://example.com/openai /gpt-5' , {
252+ const request = new Request < unknown , IncomingRequestCfProperties > ( 'https://example.com/chat /gpt-5' , {
253253 headers : { Authorization : 'healthy' } ,
254254 } )
255255
0 commit comments