fix: apply CodeRabbit auto-fixes

This commit is contained in:
Chris Scott committed 2026-11-03 08:29:59 -05:00
1 parent 3e6ebbd1dc
commit 8d92f86142
10 files changed
+262 -28

No files matched your search

+34
View File
@@ -362,6 +362,28 @@ describe('probeOpenCodeServer', () => {
})
})
it('reports unauthorized when the server rejects the credentials with an empty body', async () => {
const server = await startProbeServer((_request, response) => {
response.writeHead(401, { 'content-type': 'text/plain' })
response.end()
})
await expect(probeOpenCodeServer(server.baseUrl, CREDENTIALS, 1000)).resolves.toEqual({
status: 'unauthorized',
})
})
it('reports unauthorized when the server rejects the credentials with a plain text body', async () => {
const server = await startProbeServer((_request, response) => {
response.writeHead(401, { 'content-type': 'text/plain' })
response.end('unauthorized')
})
await expect(probeOpenCodeServer(server.baseUrl, CREDENTIALS, 1000)).resolves.toEqual({
status: 'unauthorized',
})
})
it('reports unreachable with the HTTP status for an unexpected response', async () => {
const server = await startProbeServer((_request, response) => {
response.writeHead(500, { 'content-type': 'application/json' })
@@ -374,6 +396,18 @@ describe('probeOpenCodeServer', () => {
})
})
it('reports unreachable with the HTTP status for an unexpected plain text response', async () => {
const server = await startProbeServer((_request, response) => {
response.writeHead(500, { 'content-type': 'text/plain' })
response.end('boom')
})
await expect(probeOpenCodeServer(server.baseUrl, CREDENTIALS, 1000)).resolves.toEqual({
status: 'unreachable',
message: 'HTTP 500',
})
})
it('reports unreachable when the server refuses the connection', async () => {
const server = await startProbeServer(() => {})
const baseUrl = server.baseUrl