MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / test

Function test

test/error_handling_for_primitives.js:21–29  ·  view source on GitHub ↗
(binding)

Source from the content-addressed store, hash-verified

19}
20
21function test (binding) {
22 canThrow(binding, '404 server not found!', 'string');
23 canThrow(binding, 42, 'number');
24 canThrow(binding, Symbol.for('newSym'), 'symbol');
25 canThrow(binding, false, 'boolean');
26 canThrow(binding, BigInt(123), 'bigint');
27 canThrow(binding, () => { console.log('Logger shutdown incorrectly'); }, 'function');
28 canThrow(binding, { status: 403, errorMsg: 'Not authenticated' }, 'object');
29}

Calls 2

canThrowFunction · 0.85
BigIntClass · 0.85

Tested by

no test coverage detected