Log suite start failures in the test runner
This commit is contained in:
parent
c19d76f9b8
commit
662ac5548f
@ -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) {};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user