@@ -59,7 +59,6 @@ describe('compression()', function () {
59
59
res . write ( 1 )
60
60
} catch ( err ) {
61
61
assert . ok ( err . code === 'ERR_INVALID_ARG_TYPE' )
62
- res . statusCode = 500
63
62
res . flush ( )
64
63
res . end ( )
65
64
}
@@ -68,7 +67,7 @@ describe('compression()', function () {
68
67
request ( server )
69
68
. get ( '/' )
70
69
. set ( 'Accept-Encoding' , 'gzip' )
71
- . expect ( 500 , done )
70
+ . expect ( 200 , done )
72
71
} )
73
72
74
73
it ( 'res.write({}) should fire ERR_INVALID_ARG_TYPE' , function ( done ) {
@@ -78,7 +77,6 @@ describe('compression()', function () {
78
77
res . write ( { } )
79
78
} catch ( err ) {
80
79
assert . ok ( err . code === 'ERR_INVALID_ARG_TYPE' )
81
- res . statusCode = 500
82
80
res . flush ( )
83
81
res . end ( )
84
82
}
@@ -87,17 +85,16 @@ describe('compression()', function () {
87
85
request ( server )
88
86
. get ( '/' )
89
87
. set ( 'Accept-Encoding' , 'gzip' )
90
- . expect ( 500 , done )
88
+ . expect ( 200 , done )
91
89
} )
92
90
93
- it ( 'res.write(null) should fire ERR_STREAM_NULL_VALUES' , function ( done ) {
91
+ it ( 'res.write(null) should fire ERR_INVALID_ARG_TYPE or ERR_STREAM_NULL_VALUES' , function ( done ) {
94
92
var server = createServer ( { threshold : 0 } , function ( req , res ) {
95
93
res . setHeader ( 'Content-Type' , 'text/plain' )
96
94
try {
97
95
res . write ( null )
98
96
} catch ( err ) {
99
- assert . ok ( err . code === 'ERR_STREAM_NULL_VALUES' )
100
- res . statusCode = 500
97
+ assert . ok ( err . code === 'ERR_INVALID_ARG_TYPE' || err . code === 'ERR_STREAM_NULL_VALUES' )
101
98
res . flush ( )
102
99
res . end ( )
103
100
}
@@ -106,7 +103,7 @@ describe('compression()', function () {
106
103
request ( server )
107
104
. get ( '/' )
108
105
. set ( 'Accept-Encoding' , 'gzip' )
109
- . expect ( 500 , done )
106
+ . expect ( 200 , done )
110
107
} )
111
108
} )
112
109
0 commit comments