summaryrefslogtreecommitdiff
path: root/test/addons
diff options
context:
space:
mode:
Diffstat (limited to 'test/addons')
-rw-r--r--test/addons/hello-world/test.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/addons/hello-world/test.js b/test/addons/hello-world/test.js
index b0148e9d9e..d1d67d34f6 100644
--- a/test/addons/hello-world/test.js
+++ b/test/addons/hello-world/test.js
@@ -1,6 +1,13 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
-const binding = require(`./build/${common.buildType}/binding`);
+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);