MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / testShouldThrowErrorIfKeyIsInvalid

Function testShouldThrowErrorIfKeyIsInvalid

test/object/set_property.js:14–18  ·  view source on GitHub ↗
(nativeSetProperty)

Source from the content-addressed store, hash-verified

12 }
13
14 function testShouldThrowErrorIfKeyIsInvalid (nativeSetProperty) {
15 assert.throws(() => {
16 nativeSetProperty(undefined, 'test', 1);
17 }, /Cannot convert undefined or null to object/);
18 }
19
20 testSetProperty(binding.object.setPropertyWithNapiValue);
21 testSetProperty(binding.object.setPropertyWithNapiWrapperValue);

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56