Log suite start failures in the test runner

This commit is contained in:
Tim van der Meij 2020-08-01 20:57:51 +02:00
parent c19d76f9b8
commit 662ac5548f
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -51,7 +51,21 @@ var TestReporter = function (browser) {
sendInfo("Started tests for " + browser + ".");
};
this.suiteStarted = function (result) {};
this.suiteStarted = function (result) {
// Normally suite starts don't have to be reported because the individual
// specs inside them are reported, but it can happen that the suite cannot
// start, for instance due to an uncaught exception in `beforeEach`. This
// is problematic because the specs inside the suite will never be found
// and run, so if we don't report the suite start failure here it would be
// ignored silently, leading to passing tests even though some did not run.
if (result.failedExpectations.length > 0) {
let failedMessages = "";
for (const item of result.failedExpectations) {
failedMessages += `${item.message} `;
}
sendResult("TEST-UNEXPECTED-FAIL", result.description, failedMessages);
}
};
this.specStarted = function (result) {};