Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #266 from davidaurelio/master

Don’t affect line numbers with --requireJsSetup
  • Loading branch information...
commit cd0db30287f6c426234c0ab9ad9192e9689eeab0 2 parents cbac9fe + fbdbb60
@tebriel tebriel authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/jasmine-node/requirejs-runner.js
View
9 lib/jasmine-node/requirejs-runner.js
@@ -67,20 +67,19 @@ exports.executeJsRunner = function(specCollection, done, jasmineEnv, setupFile)
};
specCollection.getSpecs().forEach(function(s){
- var script = fs.readFileSync(s.path(), 'utf8'),
- wrappedScript;
+ var script = fs.readFileSync(s.path(), 'utf8');
if (s.filename().substr(-6).toLowerCase() == 'coffee') {
script = coffeescript.compile(script);
}
- wrappedScript = template + script;
-
var newContext = buildNewContext(s);
newContext.setTimeout = jasmine.getGlobal().setTimeout;
newContext.setInterval = jasmine.getGlobal().setInterval;
- vm.runInNewContext(wrappedScript, newContext, s.path());
+ var vmContext = vm.createContext(newContext);
+ vm.runInContext(template, vmContext);
+ vm.runInContext(script, vmContext, s.path());
});
specLoader.executeWhenAllSpecsAreComplete(jasmineEnv);
Please sign in to comment.
Something went wrong with that request. Please try again.