n-api: change assert ok check to notStrictEqual.
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
049f7d8af7
commit
6e312c5cc7
@ -28,9 +28,9 @@ assert.strictEqual(test_general.testGetPrototype(baseObject),
|
|||||||
Object.getPrototypeOf(baseObject));
|
Object.getPrototypeOf(baseObject));
|
||||||
assert.strictEqual(test_general.testGetPrototype(extendedObject),
|
assert.strictEqual(test_general.testGetPrototype(extendedObject),
|
||||||
Object.getPrototypeOf(extendedObject));
|
Object.getPrototypeOf(extendedObject));
|
||||||
assert.ok(test_general.testGetPrototype(baseObject) !==
|
// Prototypes for base and extended should be different.
|
||||||
test_general.testGetPrototype(extendedObject),
|
assert.notStrictEqual(test_general.testGetPrototype(baseObject),
|
||||||
'Prototypes for base and extended should be different');
|
test_general.testGetPrototype(extendedObject));
|
||||||
|
|
||||||
// test version management functions
|
// test version management functions
|
||||||
// expected version is currently 1
|
// expected version is currently 1
|
||||||
@ -70,17 +70,15 @@ assert.strictEqual(test_general.derefItemWasCalled(), true,
|
|||||||
// Assert that wrapping twice fails.
|
// Assert that wrapping twice fails.
|
||||||
const x = {};
|
const x = {};
|
||||||
test_general.wrap(x);
|
test_general.wrap(x);
|
||||||
assert.throws(function() {
|
assert.throws(() => test_general.wrap(x), Error);
|
||||||
test_general.wrap(x);
|
|
||||||
}, Error);
|
|
||||||
|
|
||||||
// Ensure that wrapping, removing the wrap, and then wrapping again works.
|
// Ensure that wrapping, removing the wrap, and then wrapping again works.
|
||||||
const y = {};
|
const y = {};
|
||||||
test_general.wrap(y);
|
test_general.wrap(y);
|
||||||
test_general.removeWrap(y);
|
test_general.removeWrap(y);
|
||||||
assert.doesNotThrow(function() {
|
assert.doesNotThrow(() => test_general.wrap(y), Error,
|
||||||
test_general.wrap(y);
|
'Wrapping twice succeeds if a remove_wrap()' +
|
||||||
}, Error, 'Wrapping twice succeeds if a remove_wrap() separates the instances');
|
' separates the instances');
|
||||||
|
|
||||||
// Ensure that removing a wrap and garbage collecting does not fire the
|
// Ensure that removing a wrap and garbage collecting does not fire the
|
||||||
// finalize callback.
|
// finalize callback.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user