@@ -3,6 +3,8 @@ var bytes = require('bytes')
3
3
var crypto = require ( 'crypto' )
4
4
var http = require ( 'http' )
5
5
var request = require ( 'supertest' )
6
+ var OutgoingMessage = http . OutgoingMessage
7
+ var hasCallbacks = ( OutgoingMessage . prototype . write . length === 3 )
6
8
7
9
var compression = require ( '..' )
8
10
@@ -679,10 +681,8 @@ describe('compression()', function () {
679
681
680
682
describe ( 'when callbacks are used' , function ( ) {
681
683
it ( 'should call the passed callbacks in the order passed when compressing' , function ( done ) {
682
- var hasCallbacks = false
683
684
var callbackOutput = [ ]
684
685
var server = createServer ( null , function ( req , res ) {
685
- hasCallbacks = ( res . _write . length === 3 && res . _end . length === 3 )
686
686
res . setHeader ( 'Content-Type' , 'text/plain' )
687
687
res . write ( 'Hello' , null , function ( ) {
688
688
callbackOutput . push ( 0 )
@@ -712,10 +712,8 @@ describe('compression()', function () {
712
712
} )
713
713
714
714
it ( 'should call the passed callbacks in the order passed when not compressing' , function ( done ) {
715
- var hasCallbacks = false
716
715
var callbackOutput = [ ]
717
716
var server = createServer ( null , function ( req , res ) {
718
- hasCallbacks = ( res . _write . length === 3 && res . _end . length === 3 )
719
717
res . setHeader ( 'Cache-Control' , 'no-transform' )
720
718
res . setHeader ( 'Content-Type' , 'text/plain' )
721
719
res . write ( 'hello,' , null , function ( ) {
0 commit comments