Commit 0ac87c2 1 parent cd7cee5 commit 0ac87c2 Copy full SHA for 0ac87c2
File tree 1 file changed +9
-12
lines changed
test/addons-napi/test_error
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -60,29 +60,26 @@ assert.throws(() => {
60
60
test_error . throwTypeError ( ) ;
61
61
} , / ^ T y p e E r r o r : t y p e e r r o r $ / ) ;
62
62
63
- assert . throws (
63
+ common . expectsError (
64
64
( ) => test_error . throwErrorCode ( ) ,
65
- common . expectsError ( {
65
+ {
66
66
code : 'ERR_TEST_CODE' ,
67
67
message : 'Error [error]'
68
- } )
69
- ) ;
68
+ } ) ;
70
69
71
- assert . throws (
70
+ common . expectsError (
72
71
( ) => test_error . throwRangeErrorCode ( ) ,
73
- common . expectsError ( {
72
+ {
74
73
code : 'ERR_TEST_CODE' ,
75
74
message : 'RangeError [range error]'
76
- } )
77
- ) ;
75
+ } ) ;
78
76
79
- assert . throws (
77
+ common . expectsError (
80
78
( ) => test_error . throwTypeErrorCode ( ) ,
81
- common . expectsError ( {
79
+ {
82
80
code : 'ERR_TEST_CODE' ,
83
81
message : 'TypeError [type error]'
84
- } )
85
- ) ;
82
+ } ) ;
86
83
87
84
let error = test_error . createError ( ) ;
88
85
assert . ok ( error instanceof Error , 'expected error to be an instance of Error' ) ;
You can’t perform that action at this time.
0 commit comments