@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user