Skip to content

Commit 4e13c52

Browse files
committed
Add compression test for unknown encoding
1 parent 237276e commit 4e13c52

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

__tests__/responses.unit.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ describe('Response Tests:', function() {
312312
expect(result).toEqual({ multiValueHeaders: { 'content-encoding': ['deflate'], 'content-type': ['application/json'] }, statusCode: 200, body, isBase64Encoded: true })
313313
}) // end it
314314

315+
it('Compression (Unknown)', async function() {
316+
let _event = Object.assign({},event,{ path: '/testCompression'})
317+
_event.multiValueHeaders['Accept-Encoding'] = ['xxx']
318+
let result = await new Promise(r => api5.run(_event,{},(e,res) => { r(res) }))
319+
let body = `{"object":true}`
320+
expect(result).toEqual({ multiValueHeaders: { 'content-type': ['application/json'] }, statusCode: 200, body, isBase64Encoded: false })
321+
}) // end it
322+
315323
afterEach(function() {
316324
stub.restore()
317325
})

0 commit comments

Comments
 (0)