@@ -42,15 +42,15 @@ test('Abort before sending request (no body)', async (t) => {
42
42
43
43
const body = new Readable ( { read ( ) { } } )
44
44
body . on ( 'error' , ( err ) => {
45
- ttype ( p , err , errors . RequestAbortedError )
45
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
46
46
} )
47
47
client . request ( {
48
48
path : '/' ,
49
49
method : 'GET' ,
50
50
signal : ee ,
51
51
body
52
52
} , ( err , response ) => {
53
- ttype ( p , err , errors . RequestAbortedError )
53
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
54
54
} )
55
55
56
56
ee . emit ( 'abort' )
@@ -96,7 +96,7 @@ test('Abort before sending request (no body) async iterator', async (t) => {
96
96
signal : ee ,
97
97
body
98
98
} , ( err , response ) => {
99
- ttype ( p , err , errors . RequestAbortedError )
99
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
100
100
} )
101
101
102
102
ee . emit ( 'abort' )
@@ -121,7 +121,7 @@ test('Abort while waiting response (no body)', async (t) => {
121
121
t . after ( client . destroy . bind ( client ) )
122
122
123
123
client . request ( { path : '/' , method : 'GET' , signal : ee } , ( err , response ) => {
124
- ttype ( p , err , errors . RequestAbortedError )
124
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
125
125
} )
126
126
} )
127
127
@@ -145,7 +145,7 @@ test('Abort while waiting response (write headers started) (no body)', async (t)
145
145
t . after ( client . destroy . bind ( client ) )
146
146
147
147
client . request ( { path : '/' , method : 'GET' , signal : ee } , ( err , response ) => {
148
- ttype ( p , err , errors . RequestAbortedError )
148
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
149
149
} )
150
150
} )
151
151
@@ -172,7 +172,7 @@ test('Abort while waiting response (write headers and write body started) (no bo
172
172
ee . emit ( 'abort' )
173
173
} )
174
174
response . body . on ( 'error' , err => {
175
- ttype ( p , err , errors . RequestAbortedError )
175
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
176
176
} )
177
177
} )
178
178
} )
@@ -196,7 +196,7 @@ function waitingWithBody (body, type) {
196
196
t . after ( client . destroy . bind ( client ) )
197
197
198
198
client . request ( { path : '/' , method : 'POST' , body, signal : ee } , ( err , response ) => {
199
- ttype ( p , err , errors . RequestAbortedError )
199
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
200
200
} )
201
201
} )
202
202
await p . completed
@@ -226,7 +226,7 @@ function writeHeadersStartedWithBody (body, type) {
226
226
t . after ( client . destroy . bind ( client ) )
227
227
228
228
client . request ( { path : '/' , method : 'POST' , body, signal : ee } , ( err , response ) => {
229
- ttype ( p , err , errors . RequestAbortedError )
229
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
230
230
} )
231
231
} )
232
232
await p . completed
@@ -259,7 +259,7 @@ function writeBodyStartedWithBody (body, type) {
259
259
ee . emit ( 'abort' )
260
260
} )
261
261
response . body . on ( 'error' , err => {
262
- ttype ( p , err , errors . RequestAbortedError )
262
+ p . ok ( ttype ( err , errors . RequestAbortedError ) )
263
263
} )
264
264
} )
265
265
} )
0 commit comments