Skip to content

Commit 4653825

Browse files
test(response.write): should have Content-Encoding header
1 parent d76b3cb commit 4653825

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/compression.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('compression()', function () {
2828
request(server)
2929
.get('/')
3030
.set('Accept-Encoding', 'gzip')
31+
.expect(shouldHaveHeader('Content-Encoding'))
3132
.expect(shouldHaveBodyLength(reponseText.length))
3233
.expect(200, done)
3334
})
@@ -702,6 +703,12 @@ function shouldHaveBodyLength (length) {
702703
}
703704
}
704705

706+
function shouldHaveHeader (header) {
707+
return function (res) {
708+
assert.ok((header.toLowerCase() in res.headers), 'should have header ' + header)
709+
}
710+
}
711+
705712
function shouldNotHaveHeader (header) {
706713
return function (res) {
707714
assert.ok(!(header.toLowerCase() in res.headers), 'should not have header ' + header)

0 commit comments

Comments
 (0)