Not dying when there is a suite with no specs - this seems to happen in the bundled requirejs example.

This commit is contained in:
Kelvin Luck 2013-01-08 13:19:02 +00:00
parent 0e5d54587d
commit d6796a57a4

View File

@ -90,12 +90,14 @@
}; };
PhantomReporter.prototype.reportSuiteResults = function(suite) { PhantomReporter.prototype.reportSuiteResults = function(suite) {
suite.timestamp = new Date(); if (suite.specs().length) {
suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime; suite.timestamp = new Date();
phantom.sendMessage('jasmine.reportSuiteResults',{ suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime;
description : suite.description, phantom.sendMessage('jasmine.reportSuiteResults',{
results : suite.results() description : suite.description,
}); results : suite.results()
});
}
}; };
function stringify(obj) { function stringify(obj) {