Don't display late errors as AfterAll errors in the HTML reporter

This commit is contained in:
Steve Gravrock
2021-09-11 08:57:50 -07:00
parent d092a59bd1
commit 6e10f22403
7 changed files with 82 additions and 20 deletions

View File

@@ -339,15 +339,15 @@ getJasmineRequireObj().Env = function(j$) {
};
function recordLateError(error) {
topSuite.result.failedExpectations.push(
expectationResultFactory({
error,
passed: false,
matcherName: '',
expected: '',
actual: ''
})
);
const result = expectationResultFactory({
error,
passed: false,
matcherName: '',
expected: '',
actual: ''
});
result.globalErrorType = 'lateError';
topSuite.result.failedExpectations.push(result);
}
function recordLateExpectation(runable, runableType, result) {

View File

@@ -12,6 +12,9 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
* @property {Boolean} passed - Whether the expectation passed or failed.
* @property {Object} expected - If the expectation failed, what was the expected value.
* @property {Object} actual - If the expectation failed, what actual value was produced.
* @property {String|undefined} globalErrorType - The type of an error that
* is reported on the top suite. Valid values are undefined, "afterAll",
* "load", "lateExpectation", and "lateError".
*/
var result = {
matcherName: options.matcherName,