Report loading errors as loading errors, not afterAll errors

[#24901981]
This commit is contained in:
Steve Gravrock
2017-11-01 13:42:15 -07:00
parent 7b8edcb401
commit 26a7bc6acf
7 changed files with 79 additions and 11 deletions

View File

@@ -195,16 +195,23 @@ describe("HtmlReporter", function() {
reporter.jasmineStarted({});
reporter.suiteDone({ status: 'failed', failedExpectations: [{ message: 'My After All Exception' }] });
reporter.suiteDone({ status: 'failed', failedExpectations: [{ message: 'My Other Exception' }] });
reporter.jasmineDone({ failedExpectations: [{ message: 'Global After All Failure' }, { message: 'Other Global' }] });
reporter.jasmineDone({ failedExpectations: [
{ message: 'Global After All Failure', globalErrorType: 'afterAll' },
{ message: 'Other Global' },
{ message: 'Your JS is borken', globalErrorType: 'load' }
] });
var alertBars = container.querySelectorAll(".jasmine-alert .jasmine-bar");
expect(alertBars.length).toEqual(5);
expect(alertBars.length).toEqual(6);
expect(alertBars[1].innerHTML).toMatch(/My After All Exception/);
expect(alertBars[1].getAttribute("class")).toEqual('jasmine-bar jasmine-errored');
expect(alertBars[2].innerHTML).toMatch(/My Other Exception/);
expect(alertBars[3].innerHTML).toMatch(/Global After All Failure/);
expect(alertBars[3].innerHTML).toMatch(/AfterAll Global After All Failure/);
// TODO: What about this?
expect(alertBars[4].innerHTML).toMatch(/Other Global/);
expect(alertBars[5].innerHTML).toMatch(/Error during loading: Your JS is borken/);
});
});