fix(streaming.test): verify response status and content type for stream requests

This commit is contained in:
Kyush 2026-04-23 17:53:39 +09:00
commit 7f574a2f22

View file

@ -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);