File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
test/addons-napi/test_error Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -60,29 +60,26 @@ assert.throws(() => {
6060 test_error . throwTypeError ( ) ;
6161} , / ^ T y p e E r r o r : t y p e e r r o r $ / ) ;
6262
63- assert . throws (
63+ common . expectsError (
6464 ( ) => test_error . throwErrorCode ( ) ,
65- common . expectsError ( {
65+ {
6666 code : 'ERR_TEST_CODE' ,
6767 message : 'Error [error]'
68- } )
69- ) ;
68+ } ) ;
7069
71- assert . throws (
70+ common . expectsError (
7271 ( ) => test_error . throwRangeErrorCode ( ) ,
73- common . expectsError ( {
72+ {
7473 code : 'ERR_TEST_CODE' ,
7574 message : 'RangeError [range error]'
76- } )
77- ) ;
75+ } ) ;
7876
79- assert . throws (
77+ common . expectsError (
8078 ( ) => test_error . throwTypeErrorCode ( ) ,
81- common . expectsError ( {
79+ {
8280 code : 'ERR_TEST_CODE' ,
8381 message : 'TypeError [type error]'
84- } )
85- ) ;
82+ } ) ;
8683
8784let error = test_error . createError ( ) ;
8885assert . ok ( error instanceof Error , 'expected error to be an instance of Error' ) ;
You can’t perform that action at this time.
0 commit comments