Skip to content

Commit 6db66b8

Browse files
v1rtlclaude
andcommitted
test(send): add test for unsupported status codes in sendStatus
Add test covering the String(statusCode) fallback branch when an unsupported HTTP status code (e.g., 999) is used. Improves sendStatus.ts coverage: - Branches: 50% -> 100% Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 848a59e commit 6db66b8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/modules/send.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ describe('sendStatus(status)', () => {
154154

155155
await makeFetch(app)('/').expect("I'm a Teapot")
156156
})
157+
it('should send stringified status code for unsupported status codes', async () => {
158+
const app = runServer((req, res) => sendStatus(req, res)(999).end())
159+
160+
await makeFetch(app)('/').expect(999, '999')
161+
})
157162
})
158163

159164
describe('sendFile(path)', () => {

0 commit comments

Comments
 (0)