Skip to content

Commit

Permalink
Add compression test for unknown encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Jul 8, 2021
1 parent 237276e commit 4e13c52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/responses.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ describe('Response Tests:', function() {
expect(result).toEqual({ multiValueHeaders: { 'content-encoding': ['deflate'], 'content-type': ['application/json'] }, statusCode: 200, body, isBase64Encoded: true })
}) // end it

it('Compression (Unknown)', async function() {
let _event = Object.assign({},event,{ path: '/testCompression'})
_event.multiValueHeaders['Accept-Encoding'] = ['xxx']
let result = await new Promise(r => api5.run(_event,{},(e,res) => { r(res) }))
let body = `{"object":true}`
expect(result).toEqual({ multiValueHeaders: { 'content-type': ['application/json'] }, statusCode: 200, body, isBase64Encoded: false })
}) // end it

afterEach(function() {
stub.restore()
})
Expand Down

0 comments on commit 4e13c52

Please sign in to comment.