Skip to content

Commit b3abbf7

Browse files
committed
test: normalize fetch helpers review nit
1 parent 29c8f7d commit b3abbf7

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

test/fetch-helpers.test.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,12 @@ describe('Fetch Helpers Module', () => {
469469
error: {
470470
code: 'usage_limit_reached',
471471
message: 'limit reached',
472-
},
473-
};
474-
const resp = new Response(JSON.stringify(body), { status: 404 });
475-
const { response: mapped, rateLimit } = await handleErrorResponse(resp);
476-
expect(mapped.status).toBe(429);
477-
const json = await mapped.json() as any;
472+
},
473+
};
474+
const resp = new Response(JSON.stringify(body), { status: 404 });
475+
const { response: mapped, rateLimit } = await handleErrorResponse(resp);
476+
expect(mapped.status).toBe(429);
477+
const json = await mapped.json() as any;
478478
expect(json.error.code).toBe('usage_limit_reached');
479479
expect(rateLimit?.retryAfterMs).toBeGreaterThan(0);
480480
});
@@ -543,15 +543,18 @@ describe('Fetch Helpers Module', () => {
543543
const body = { error: { code: 'not_found', message: 'nope' } };
544544
const resp = new Response(JSON.stringify(body), { status: 404 });
545545
const { response: result, rateLimit } = await handleErrorResponse(resp);
546-
expect(result.status).toBe(404);
547-
const json = await result.json() as any;
548-
expect(json.error.code).toBe('not_found');
549-
expect(rateLimit).toBeUndefined();
550-
});
546+
expect(result.status).toBe(404);
547+
const json = await result.json() as any;
548+
expect(json.error.code).toBe('not_found');
549+
expect(rateLimit).toBeUndefined();
550+
});
551551

552552
it('should remove x-api-key header', () => {
553-
const init = { headers: { 'x-api-key': 'should-be-removed' } } as any;
554-
const headers = createCodexHeaders(init, accountId, accessToken, { model: 'gpt-5', promptCacheKey: 'session-2' });
553+
const init = { headers: { 'x-api-key': 'should-be-removed' } } as any;
554+
const headers = createCodexHeaders(init, accountId, accessToken, {
555+
model: 'gpt-5',
556+
promptCacheKey: 'session-2',
557+
});
555558

556559
expect(headers.has('x-api-key')).toBe(false);
557560
});

0 commit comments

Comments
 (0)