Updating test case to cover this scenario properly.
This commit is contained in:
parent
fd94e3aea9
commit
ed1f9f19a7
|
@ -245,13 +245,13 @@ describe("REST Integration", () => {
|
||||||
expect(output.extra.headers["content-type"]).toEqual("application/xml")
|
expect(output.extra.headers["content-type"]).toEqual("application/xml")
|
||||||
})
|
})
|
||||||
|
|
||||||
test.each(contentTypes)(
|
test.each([...contentTypes, undefined])(
|
||||||
"should not throw an error on 204 no content",
|
"should not throw an error on 204 no content",
|
||||||
async contentType => {
|
async contentType => {
|
||||||
const input = buildInput(undefined, null, contentType, 204)
|
const input = buildInput(undefined, null, contentType, 204)
|
||||||
const output = await config.integration.parseResponse(input)
|
const output = await config.integration.parseResponse(input)
|
||||||
expect(output.data).toEqual([])
|
expect(output.data).toEqual([])
|
||||||
expect(output.extra.raw).toEqual([])
|
expect(output.extra.raw).toEqual("")
|
||||||
expect(output.info.code).toEqual(204)
|
expect(output.info.code).toEqual(204)
|
||||||
expect(output.extra.headers["content-type"]).toEqual(contentType)
|
expect(output.extra.headers["content-type"]).toEqual(contentType)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue