Remove Env's calculation of executionTime

[#45659879]
This commit is contained in:
Sheel Choksi
2013-07-03 14:12:19 -07:00
parent 179e54b9fb
commit 34b8bf5fb0
3 changed files with 6 additions and 21 deletions

View File

@@ -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);
};
}

View File

@@ -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() {

View File

@@ -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);
};
}