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

Function testMethod

test/objectwrap.js:100–110  ·  view source on GitHub ↗
(obj, clazz)

Source from the content-addressed store, hash-verified

98 };
99
100 const testMethod = (obj, clazz) => {
101 assert.strictEqual(obj.testMethod('method'), 'method instance');
102 assert.strictEqual(obj[clazz.kTestMethodInternal]('method'), 'method instance internal');
103 obj.testVoidMethodT('method<>(const char*)');
104 assert.strictEqual(obj.testMethodT(), 'method<>(const char*)');
105 obj[clazz.kTestVoidMethodTInternal]('method<>(Symbol)');
106 assert.strictEqual(obj[clazz.kTestMethodTInternal](), 'method<>(Symbol)');
107 assert.throws(() => clazz.prototype.testMethod('method'));
108 assert.throws(() => clazz.prototype.testMethodT());
109 assert.throws(() => clazz.prototype.testVoidMethodT('method<>(const char*)'));
110 };
111
112 const testEnumerables = (obj, clazz) => {
113 // Object.keys: only object without prototype

Callers 1

testObjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected