Skip to content

Commit 03361ec

Browse files
test(response.write): fix test expect
1 parent 3ad026f commit 03361ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/compression.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ var compression = require('..')
1111

1212
describe('compression()', function () {
1313
it('request should end', function (done) {
14+
var reponseText = 'hello, world'
15+
1416
var server = createServer({ threshold: 0 }, function (req, res) {
1517
res.setHeader('Content-Type', 'text/plain')
1618

17-
res.write(Buffer.from('hello, world'), (err) => {
19+
res.write(Buffer.from(reponseText), (err) => {
1820
if (err) {
1921
console.error('err', err)
2022
}
@@ -26,7 +28,7 @@ describe('compression()', function () {
2628
request(server)
2729
.get('/')
2830
.set('Accept-Encoding', 'gzip')
29-
.expect(shouldNotHaveHeader('Content-Encoding'))
31+
.expect(shouldHaveBodyLength(reponseText.length))
3032
.expect(200, done)
3133
})
3234

0 commit comments

Comments
 (0)