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 11"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 +
145145 }
146146 }
147147 } ) ;
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+ } ) ;
148154 it ( "should not influence the original require if nothing has been required within the rewired module" , function ( ) {
149155 rewire ( "./emptyModule.js" ) ; // nothing happens here because emptyModule doesn't require anything
150156 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