Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a8ba82

Browse files
committed
Move shared test cases into lib folder
Since new versions of npm respect the .npmignore even when it comesfrom git urls, we need to move the shared test cases into the lib folderin order to provide these cases to other modules which port rewire'sfunctionality to other environments.As discussed atjhnns/rewire-webpack#18
1 parentac0c8a3 commit5a8ba82

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-
varmyNumber=0;
4-
5-
module.exports=function(){
6-
myNumber=1;
1+
"use strict";// run code in ES5 strict mode
2+
3+
varmyNumber=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-
varsomeVar;
4-
1+
"use strict";// run code in ES5 strict mode
2+
3+
varsomeVar;
4+
55
// Comment on file end. Hope this won't break anything
File renamed without changes.
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-
functiondoSomethingUnstrict(){
4-
varcaller=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+
functiondoSomethingUnstrict(){
4+
varcaller=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
varcoffeeModule;
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)

[8]ページ先頭

©2009-2025 Movatter.jp