Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a8ba82

Browse files
committed
Move shared test cases into lib folder
Since new versions of npm respect the .npmignore even when it comes from git urls, we need to move the shared test cases into the lib folder in order to provide these cases to other modules which port rewire's functionality to other environments. As discussed at jhnns/rewire-webpack#18
1 parent ac0c8a3 commit 5a8ba82

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"use strict"; // run code in ES5 strict mode
2-
3-
var myNumber = 0;
4-
5-
module.exports = function () {
6-
myNumber = 1;
1+
"use strict"; // run code in ES5 strict mode
2+
3+
var myNumber = 0;
4+
5+
module.exports = function () {
6+
myNumber = 1;
77
};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"use strict"; // run code in ES5 strict mode
2-
3-
var someVar;
4-
1+
"use strict"; // run code in ES5 strict mode
2+
3+
var someVar;
4+
55
// Comment on file end. Hope this won't break anything
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"use strict"; // run code in ES5 strict mode
2-
3-
function doSomethingUnstrict() {
4-
var caller = arguments.callee.caller; // this should throw an error as a proof that strict mode is on
5-
}
6-
1+
"use strict"; // run code in ES5 strict mode
2+
3+
function doSomethingUnstrict() {
4+
var caller = arguments.callee.caller; // this should throw an error as a proof that strict mode is on
5+
}
6+
77
exports.doSomethingUnstrict = doSomethingUnstrict;
File renamed without changes.

test/rewire.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ describe("rewire", function () {
1717
}
1818
});
1919
it("should pass all shared test cases", function () {
20-
require("./testModules/sharedTestCases.js");
20+
require("../lib/testModules/sharedTestCases.js");
2121
});
2222
it("should also work with CoffeeScript", function () {
2323
var coffeeModule;
2424

2525
rewire = require("../");
26-
coffeeModule = rewire("./testModules/module.coffee");
26+
coffeeModule = rewire("../lib/testModules/module.coffee");
2727
coffeeModule.__set__("fs", {
2828
readFileSync: function () {
2929
return "It works!";
3030
}
3131
});
3232
expect(coffeeModule.readFileSync()).to.be("It works!");
3333
});
34-
});
34+
});

0 commit comments

Comments
 (0)