diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 8a6ee24c..f192fd48 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -308,8 +308,7 @@ getJasmineRequireObj().Env = function(j$) { function Env(options) { options = options || {}; var self = this; - var global = options.global || j$.getGlobal(), - now = options.now || function() { return new Date().getTime(); }; + var global = options.global || j$.getGlobal(); var catchExceptions = true; @@ -500,13 +499,10 @@ getJasmineRequireObj().Env = function(j$) { }; this.execute = function() { - var startTime = now(); this.reporter.jasmineStarted({ totalSpecsDefined: totalSpecsDefined }); - this.topSuite.execute(function() { - self.reporter.jasmineDone({executionTime: now() - startTime}); - }); + this.topSuite.execute(self.reporter.jasmineDone); }; } diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 4e85917e..fbb69b45 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -191,9 +191,7 @@ describe("Env integration", function() { // TODO: something is wrong with this spec it("should report as expected", function(done) { - var fakeNow = jasmine.createSpy('fake Date.now'), - env = new j$.Env({now: fakeNow}), - reporter = jasmine.createSpyObj('fakeReporter', [ + var reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineStarted", "jasmineDone", "suiteStarted", @@ -208,16 +206,11 @@ describe("Env integration", function() { }); var suiteResult = reporter.suiteStarted.calls[0].args[0]; expect(suiteResult.description).toEqual("A Suite"); - expect(reporter.jasmineDone).toHaveBeenCalledWith({ - executionTime: 1000 - }); + expect(reporter.jasmineDone).toHaveBeenCalled(); done(); }); - fakeNow.andReturn(500); - reporter.suiteDone.andCallFake(function() { fakeNow.andReturn(1500); }); - env.addReporter(reporter); env.describe("A Suite", function() { diff --git a/src/core/Env.js b/src/core/Env.js index beaad9fb..673e838c 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -2,8 +2,7 @@ getJasmineRequireObj().Env = function(j$) { function Env(options) { options = options || {}; var self = this; - var global = options.global || j$.getGlobal(), - now = options.now || function() { return new Date().getTime(); }; + var global = options.global || j$.getGlobal(); var catchExceptions = true; @@ -194,13 +193,10 @@ getJasmineRequireObj().Env = function(j$) { }; this.execute = function() { - var startTime = now(); this.reporter.jasmineStarted({ totalSpecsDefined: totalSpecsDefined }); - this.topSuite.execute(function() { - self.reporter.jasmineDone({executionTime: now() - startTime}); - }); + this.topSuite.execute(self.reporter.jasmineDone); }; }