Permalink
Browse files

n-api: change assert ok check to notStrictEqual.

PR-URL: #18414
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information...
nbdaaron authored and BridgeAR committed Jan 27, 2018
1 parent 049f7d8 commit 6e312c5cc7300e8c5d23301c970a1ac978950ff5
Showing with 7 additions and 9 deletions.
  1. +7 −9 test/addons-napi/test_general/test.js
@@ -28,9 +28,9 @@ assert.strictEqual(test_general.testGetPrototype(baseObject),
Object.getPrototypeOf(baseObject));
assert.strictEqual(test_general.testGetPrototype(extendedObject),
Object.getPrototypeOf(extendedObject));
assert.ok(test_general.testGetPrototype(baseObject) !==
test_general.testGetPrototype(extendedObject),
'Prototypes for base and extended should be different');
// Prototypes for base and extended should be different.
assert.notStrictEqual(test_general.testGetPrototype(baseObject),
test_general.testGetPrototype(extendedObject));
// test version management functions
// expected version is currently 1
@@ -70,17 +70,15 @@ assert.strictEqual(test_general.derefItemWasCalled(), true,
// Assert that wrapping twice fails.
const x = {};
test_general.wrap(x);
assert.throws(function() {
test_general.wrap(x);
}, Error);
assert.throws(() => test_general.wrap(x), Error);
// Ensure that wrapping, removing the wrap, and then wrapping again works.
const y = {};
test_general.wrap(y);
test_general.removeWrap(y);
assert.doesNotThrow(function() {
test_general.wrap(y);
}, Error, 'Wrapping twice succeeds if a remove_wrap() separates the instances');
assert.doesNotThrow(() => test_general.wrap(y), Error,
'Wrapping twice succeeds if a remove_wrap()' +
' separates the instances');
// Ensure that removing a wrap and garbage collecting does not fire the
// finalize callback.

0 comments on commit 6e312c5

Please sign in to comment.