xref: /third_party/node/test/addons/hello-world/test.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/hello-world/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst bindingPath = require.resolve(`./build/${common.buildType}/binding`);
51cb0ef41Sopenharmony_ciconst binding = require(bindingPath);
61cb0ef41Sopenharmony_ciassert.strictEqual(binding.hello(), 'world');
71cb0ef41Sopenharmony_ciconsole.log('binding.hello() =', binding.hello());
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci// Test multiple loading of the same module.
101cb0ef41Sopenharmony_cidelete require.cache[bindingPath];
111cb0ef41Sopenharmony_ciconst rebinding = require(bindingPath);
121cb0ef41Sopenharmony_ciassert.strictEqual(rebinding.hello(), 'world');
131cb0ef41Sopenharmony_ciassert.notStrictEqual(binding.hello, rebinding.hello);
14

Indexes created Thu Nov 07 10:32:03 CST 2024