File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -278,14 +278,22 @@ function resetCaptureOnThrowInError() {
278
278
function argValidation ( ) {
279
279
280
280
function testType ( obj ) {
281
+ const received = obj . constructor . name !== 'Number' ?
282
+ `an instance of ${ obj . constructor . name } ` :
283
+ `type number (${ obj } )` ;
284
+
281
285
assert . throws ( ( ) => new EventEmitter ( { captureRejections : obj } ) , {
282
286
code : 'ERR_INVALID_ARG_TYPE' ,
283
- name : 'TypeError'
287
+ name : 'TypeError' ,
288
+ message : 'The "options.captureRejections" property must be of type ' +
289
+ `boolean. Received ${ received } `
284
290
} ) ;
285
291
286
292
assert . throws ( ( ) => EventEmitter . captureRejections = obj , {
287
293
code : 'ERR_INVALID_ARG_TYPE' ,
288
- name : 'TypeError'
294
+ name : 'TypeError' ,
295
+ message : 'The "EventEmitter.captureRejections" property must be of ' +
296
+ `type boolean. Received ${ received } `
289
297
} ) ;
290
298
}
291
299
You can’t perform that action at this time.
0 commit comments