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:
@@ -167,8 +167,9 @@ describe("Env (integration)", function() {
|
||||
|
||||
// TODO: something is wrong with this spec
|
||||
it("should report as expected", function() {
|
||||
var env = new j$.Env(),
|
||||
reporter = jasmine.createSpyObj('fakeReproter', [
|
||||
var fakeNow = jasmine.createSpy('fake Date.now'),
|
||||
env = new j$.Env({now: fakeNow}),
|
||||
reporter = jasmine.createSpyObj('fakeReporter', [
|
||||
"jasmineStarted",
|
||||
"jasmineDone",
|
||||
"suiteStarted",
|
||||
@@ -177,6 +178,9 @@ describe("Env (integration)", function() {
|
||||
"specDone"
|
||||
]);
|
||||
|
||||
fakeNow.andReturn(500);
|
||||
reporter.suiteDone.andCallFake(function() { fakeNow.andReturn(1500); });
|
||||
|
||||
env.addReporter(reporter);
|
||||
|
||||
env.describe("A Suite", function() {
|
||||
@@ -200,7 +204,9 @@ describe("Env (integration)", function() {
|
||||
});
|
||||
var suiteResult = reporter.suiteStarted.calls[0].args[0];
|
||||
expect(suiteResult.description).toEqual("A Suite");
|
||||
expect(reporter.jasmineDone).toHaveBeenCalled();
|
||||
expect(reporter.jasmineDone).toHaveBeenCalledWith({
|
||||
executionTime: 1000
|
||||
});
|
||||
});
|
||||
|
||||
it("should be possible to get full name from a spec", function() {
|
||||
|
||||
Reference in New Issue
Block a user