mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05: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>
14 lines
523 B
JavaScript
14 lines
523 B
JavaScript
'use strict';
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
|
|
const binding = require(bindingPath);
|
|
assert.strictEqual(binding.hello(), 'world');
|
|
console.log('binding.hello() =', binding.hello());
|
|
|
|
// Test multiple loading of the same module.
|
|
delete require.cache[bindingPath];
|
|
const rebinding = require(bindingPath);
|
|
assert.strictEqual(rebinding.hello(), 'world');
|
|
assert.notStrictEqual(binding.hello, rebinding.hello);
|