fix(streaming.test): verify response status and content type for stream requests
This commit is contained in:
parent
7d44a70498
commit
7f574a2f22
1 changed files with 4 additions and 1 deletions
|
|
@ -323,7 +323,7 @@ describe('Streaming Response Proxying', () => {
|
|||
|
||||
const { userApiKey, userId } = await setupUserAndBackend(port, { detailLogging: true });
|
||||
|
||||
await request(app)
|
||||
const response = await request(app)
|
||||
.post('/v1/chat/completions')
|
||||
.set('Authorization', `Bearer ${userApiKey}`)
|
||||
.send({
|
||||
|
|
@ -332,6 +332,9 @@ describe('Streaming Response Proxying', () => {
|
|||
stream: true,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.headers['content-type']).toMatch(/text\/event-stream/);
|
||||
|
||||
const logsResponse = await admin.get(`/admin/analytics/requests?limit=1&userId=${userId}&detailLogged=1`);
|
||||
expect(logsResponse.body.rows).toHaveLength(1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue