@@ -485,7 +485,8 @@ describe('compression()', function () {
485
485
request ( server )
486
486
. get ( '/' )
487
487
. set ( 'Accept-Encoding' , 'gzip' )
488
- . expect ( 'Content-Encoding' , 'gzip' , done )
488
+ . expect ( 'Content-Encoding' , 'gzip' )
489
+ . expect ( 200 , 'hello, world' , done )
489
490
} )
490
491
491
492
it ( 'should return false writing after end' , function ( done ) {
@@ -513,7 +514,8 @@ describe('compression()', function () {
513
514
request ( server )
514
515
. get ( '/' )
515
516
. set ( 'Accept-Encoding' , 'deflate' )
516
- . expect ( 'Content-Encoding' , 'deflate' , done )
517
+ . expect ( 'Content-Encoding' , 'deflate' )
518
+ . expect ( 200 , 'hello, world' , done )
517
519
} )
518
520
} )
519
521
@@ -527,7 +529,8 @@ describe('compression()', function () {
527
529
request ( server )
528
530
. get ( '/' )
529
531
. set ( 'Accept-Encoding' , 'br' )
530
- . expect ( 'Content-Encoding' , 'br' , done )
532
+ . expect ( 'Content-Encoding' , 'br' )
533
+ . expect ( 200 , 'hello, world' , done )
531
534
} )
532
535
} )
533
536
@@ -934,6 +937,19 @@ describe('compression()', function () {
934
937
. expect ( 200 , 'hello, world' , done )
935
938
} )
936
939
940
+ brotli ( 'should compress when enforceEncoding is brotli' , function ( done ) {
941
+ var server = createServer ( { threshold : 0 , enforceEncoding : 'br' } , function ( req , res ) {
942
+ res . setHeader ( 'Content-Type' , 'text/plain' )
943
+ res . end ( 'hello, world' )
944
+ } )
945
+
946
+ request ( server )
947
+ . get ( '/' )
948
+ . set ( 'Accept-Encoding' , '' )
949
+ . expect ( 'Content-Encoding' , 'br' )
950
+ . expect ( 200 , 'hello, world' , done )
951
+ } )
952
+
937
953
it ( 'should not compress when enforceEncoding is unknown' , function ( done ) {
938
954
var server = createServer ( { threshold : 0 , enforceEncoding : 'bogus' } , function ( req , res ) {
939
955
res . setHeader ( 'Content-Type' , 'text/plain' )
0 commit comments