mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 23:06:47 +00:00

Fixes: https://github.com/nodejs/abi-stable-node/issues/51 PR-URL: https://github.com/nodejs/node/pull/15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
13 lines
461 B
JavaScript
13 lines
461 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
|
|
// addon is referenced through the eval expression in testFile
|
|
// eslint-disable-next-line no-unused-vars
|
|
const addon = require(`./build/${common.buildType}/test_general`);
|
|
|
|
assert.strictEqual(addon.testNapiRun('(41.92 + 0.08);'), 42,
|
|
'napi_run_script() works correctly');
|
|
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
|