1
0
Fork 0
mirror of synced 2024-09-12 23:43:09 +12:00

Updating test case to cover this scenario properly.

This commit is contained in:
mike12345567 2024-05-08 16:12:24 +01:00
parent fd94e3aea9
commit ed1f9f19a7

View file

@ -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)
} }