mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 12:04:25 +00:00

* Get rid of recursive `make` when building the node binary. An earlier commit makes GYP write out rules that we can use for proper dependency tracking. * Use module name 'binding' in addons.md and addons-napi/*/binding.gyp. This massively simplifies the logic for generating the build rules. * Check in auto-generated add-on tests from `doc/api/addons.md`. The files change rarely and generating them dynamically causes no end of race conditions and special-casing during the build. PR-URL: https://github.com/nodejs/node/pull/17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
16 lines
478 B
JavaScript
16 lines
478 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}/binding`);
|
|
|
|
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/);
|