@@ -63,22 +63,25 @@ let w = {};
6363test_general . wrap ( w ) ;
6464w = null ;
6565global . gc ( ) ;
66- assert . strictEqual ( test_general . derefItemWasCalled ( ) , true ,
66+ const derefItemWasCalled = test_general . derefItemWasCalled ( ) ;
67+ assert . strictEqual ( derefItemWasCalled , true ,
6768 'deref_item() was called upon garbage collecting a ' +
68- 'wrapped object' ) ;
69+ 'wrapped object. test_general.derefItemWasCalled() ' +
70+ `returned ${ derefItemWasCalled } ` ) ;
71+
6972
7073// Assert that wrapping twice fails.
7174const x = { } ;
7275test_general . wrap ( x ) ;
73- assert . throws ( ( ) => test_general . wrap ( x ) , Error ) ;
76+ common . expectsError ( ( ) => test_general . wrap ( x ) ,
77+ { type : Error , message : 'Invalid argument' } ) ;
7478
7579// Ensure that wrapping, removing the wrap, and then wrapping again works.
7680const y = { } ;
7781test_general . wrap ( y ) ;
7882test_general . removeWrap ( y ) ;
79- assert . doesNotThrow ( ( ) => test_general . wrap ( y ) , Error ,
80- 'Wrapping twice succeeds if a remove_wrap()' +
81- ' separates the instances' ) ;
83+ // Wrapping twice succeeds if a remove_wrap() separates the instances
84+ assert . doesNotThrow ( ( ) => test_general . wrap ( y ) ) ;
8285
8386// Ensure that removing a wrap and garbage collecting does not fire the
8487// finalize callback.
@@ -87,8 +90,11 @@ test_general.testFinalizeWrap(z);
8790test_general . removeWrap ( z ) ;
8891z = null ;
8992global . gc ( ) ;
90- assert . strictEqual ( test_general . finalizeWasCalled ( ) , false ,
91- 'finalize callback was not called upon garbage collection' ) ;
93+ const finalizeWasCalled = test_general . finalizeWasCalled ( ) ;
94+ assert . strictEqual ( finalizeWasCalled , false ,
95+ 'finalize callback was not called upon garbage collection.' +
96+ ' test_general.finalizeWasCalled() ' +
97+ `returned ${ finalizeWasCalled } ` ) ;
9298
9399// test napi_adjust_external_memory
94100const adjustedValue = test_general . testAdjustExternalMemory ( ) ;
0 commit comments