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) {
suite.timestamp = new Date();
suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime;
phantom.sendMessage('jasmine.reportSuiteResults',{
description : suite.description,
results : suite.results()
});
if (suite.specs().length) {
suite.timestamp = new Date();
suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime;
phantom.sendMessage('jasmine.reportSuiteResults',{
description : suite.description,
results : suite.results()
});
}
};
function stringify(obj) {