From 86805d7a720b57449753cc4108b8784ba87071cb Mon Sep 17 00:00:00 2001 From: rosston Date: Mon, 31 Oct 2016 21:17:24 -0400 Subject: [PATCH] Add failing test for native module re-requires. --- package.json | 3 ++- test/integration/native-module-require.spec.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/integration/native-module-require.spec.js diff --git a/package.json b/package.json index ccad043f..b9035849 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "license": "MIT", "scripts": { "pretest": "eslint benchmarks lib test", - "test": "mocha --recursive test", + "test": "mocha --recursive -r native-module/hello test", "bench": "bench benchmarks" }, "devDependencies": { @@ -35,6 +35,7 @@ "eslint": "2.13.0", "eslint-config-tschaub": "6.0.0", "fs-extra": "^0.30.0", + "native-module": "^0.11.3", "mocha": "3.1.2", "rimraf": "2.5.4" }, diff --git a/test/integration/native-module-require.spec.js b/test/integration/native-module-require.spec.js new file mode 100644 index 00000000..84695b7a --- /dev/null +++ b/test/integration/native-module-require.spec.js @@ -0,0 +1,10 @@ +/** + * native-module MUST have been pre-required by mocha in order for this test to + * fail properly. + */ +describe('native module re-requires', function() { + it('should work', function() { + require('../../lib/index'); + require('native-module/hello'); + }); +});