fix(web): close final workbench interaction gaps
This commit is contained in:
@@ -50,9 +50,18 @@ test('interrupted successful response body rejects with a stable invalid_respons
|
||||
})
|
||||
|
||||
test('204 response returns undefined without reading a body', async () => {
|
||||
globalThis.fetch = async () => new Response(null, { status: 204 })
|
||||
let textCalls = 0
|
||||
globalThis.fetch = async () => ({
|
||||
ok: true,
|
||||
status: 204,
|
||||
text: async () => {
|
||||
textCalls += 1
|
||||
throw new Error('204 body must not be read')
|
||||
},
|
||||
})
|
||||
|
||||
assert.equal(await apiRequest('/no-content'), undefined)
|
||||
assert.equal(textCalls, 0)
|
||||
})
|
||||
|
||||
test('explicit void response returns undefined for a non-204 response', async () => {
|
||||
|
||||
Reference in New Issue
Block a user