File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ; // run code in ES5 strict mode
2
+
3
+ var someVar ;
4
+
5
+ // Comment on file end. Hope this won't break anything
Original file line number Diff line number Diff line change @@ -145,6 +145,12 @@ describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv +
145
145
}
146
146
}
147
147
} ) ;
148
+ it ( "should not be a problem to have a comment on file end" , function ( ) {
149
+ var rewired = rewire ( "./emptyModule.js" ) ;
150
+
151
+ rewired . __set__ ( "someVar" , "hello" ) ;
152
+ expect ( rewired . __get__ ( "someVar" ) ) . to . be ( "hello" ) ;
153
+ } ) ;
148
154
it ( "should not influence the original require if nothing has been required within the rewired module" , function ( ) {
149
155
rewire ( "./emptyModule.js" ) ; // nothing happens here because emptyModule doesn't require anything
150
156
expect ( require ( "./moduleA.js" ) . __set__ ) . to . be ( undefined ) ; // if restoring the original node require didn't worked, the module would have a setter
You can’t perform that action at this time.
0 commit comments