].forEach((val) => { assert.strictEqual(test_general.testNapiTypeof(val), typeof val); });
[ 123, 'test string', function() {}, new Object(), true, undefined, Symbol() ].forEach((val) => { assert.strictEqual(test_general.testNapiTypeof(val), typeof val); }); // since typeof in js return object need to validate specific case // for null assert.strictEqual(test_general.testNapiTypeof(null), 'null'); // Ensure that garbage collecting an object with a wrapped native item results // in the finalize callback being called. let w = {}; test_general.wrap(w); w = null; global.gc(); assert.strictEqual(test_general.derefItemWasCalled(), true, 'deref_item() was called upon garbage collecting a ' + 'wrapped object'); // Assert that wrapping twice fails. const x = {}; test_general.wrap(x); assert.throws(function() {