Skip to content

Commit

Permalink
✅ test: Add test for 404 status response for ModelNotFound error type…
Browse files Browse the repository at this point in the history
… in errorResponse function. (lobehub#6361)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
  • Loading branch information
gru-agent[bot] authored Feb 20, 2025
1 parent 87a6185 commit 56c36cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/errorResponse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ describe('createErrorResponse', () => {
expect(response.status).toBe(403);
});

it('returns a 404 status for ModelNotFound error type', () => {
const errorType = AgentRuntimeErrorType.ModelNotFound;
const response = createErrorResponse(errorType);
expect(response.status).toBe(404);
});

it('returns a 429 status for InsufficientQuota error type', () => {
const errorType = AgentRuntimeErrorType.InsufficientQuota;
const response = createErrorResponse(errorType);
Expand Down

0 comments on commit 56c36cd

Please sign in to comment.