Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohannes Ewald <mail@johannesewald.de>2013-03-13 05:16:49 +0400
committerJohannes Ewald <mail@johannesewald.de>2013-03-13 05:16:49 +0400
commit70d27afabbd0a3af3a0fd3725bf198773268c676 (patch)
tree83be8f0bf57f7d06c5abd4e3aa11e1325bb666a5 /test
parent243e1c59b495887c03fb436795b2e2c477e94449 (diff)
- Rolled back fake-package.json-mechanism
Diffstat (limited to 'test')
-rw-r--r--test/rewire.test.js11
-rw-r--r--test/testModules/fake_node_modules/rewire/package.json (renamed from test/testModules/node_modules/rewire/package.json)0
2 files changed, 10 insertions, 1 deletions
diff --git a/test/rewire.test.js b/test/rewire.test.js
index 278b46b..1ac0129 100644
--- a/test/rewire.test.js
+++ b/test/rewire.test.js
@@ -2,11 +2,20 @@
// In case this module was in strict mode, all other modules called by this would also be strict.
// But when testing if the strict mode is preserved, we must ensure that this module is NOT strict.
-var expect = require("expect.js");
+var expect = require("expect.js"),
+ fs = require("fs"),
+ path = require("path");
var rewire;
describe("rewire", function () {
+ before(function () {
+ var fakeNodeModules = path.resolve(__dirname, "testModules/fake_node_modules");
+
+ if (fs.existsSync(fakeNodeModules)) {
+ fs.renameSync(fakeNodeModules, path.resolve(__dirname, "testModules/node_modules"));
+ }
+ });
it("should pass all shared test cases", function () {
require("./testModules/sharedTestCases.js");
});
diff --git a/test/testModules/node_modules/rewire/package.json b/test/testModules/fake_node_modules/rewire/package.json
index d8927cd..d8927cd 100644
--- a/test/testModules/node_modules/rewire/package.json
+++ b/test/testModules/fake_node_modules/rewire/package.json