Add execution time elapsed to JsApiReporter
Since this information is desired in ConsoleReporter, HtmlReporter, and now JsApiReporter, the executionTime is passed through in jasmineDone from Env instead of making each reporter compute it. Fixes #30, [Finishes #45659879]
This commit is contained in:
@@ -101,7 +101,7 @@ describe("JsApiReporter", function() {
|
||||
expect(reporter.finished).toBe(false);
|
||||
|
||||
reporter.jasmineStarted();
|
||||
reporter.jasmineDone();
|
||||
reporter.jasmineDone({});
|
||||
|
||||
expect(reporter.finished).toBe(true);
|
||||
});
|
||||
@@ -123,7 +123,7 @@ describe("JsApiReporter", function() {
|
||||
it("reports 'done' when Jasmine is done", function() {
|
||||
var reporter = new j$.JsApiReporter();
|
||||
|
||||
reporter.jasmineDone();
|
||||
reporter.jasmineDone({});
|
||||
|
||||
expect(reporter.status()).toEqual('done');
|
||||
});
|
||||
@@ -178,4 +178,22 @@ describe("JsApiReporter", function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("#executionTime", function() {
|
||||
var reporter;
|
||||
beforeEach(function() {
|
||||
reporter = new j$.JsApiReporter();
|
||||
});
|
||||
|
||||
it("should return the time it took the specs to run, in ms", function() {
|
||||
reporter.jasmineDone({executionTime: 1000});
|
||||
expect(reporter.executionTime()).toEqual(1000);
|
||||
});
|
||||
|
||||
describe("when the specs haven't finished being run", function() {
|
||||
it("should return undefined", function() {
|
||||
expect(reporter.executionTime()).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user