mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 07:19:19 +00:00

Partition test/addons-napi into test/js-native-api and test/node-api to isolate the Node.js-agnostic portion of the N-API tests from the Node.js-specific portion. PR-URL: https://github.com/nodejs/node/pull/24557 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
16 lines
483 B
JavaScript
16 lines
483 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`);
|
|
|
|
const testCase = '(41.92 + 0.08);';
|
|
const expected = 42;
|
|
const actual = addon.testNapiRun(testCase);
|
|
|
|
assert.strictEqual(actual, expected);
|
|
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
|