rename afterAllException to afterAllError

It should also handle expectation failures
This commit is contained in:
Gregg Van Hove
2014-04-18 16:00:02 -07:00
parent 668846147c
commit 0d4b04d37c
8 changed files with 17 additions and 17 deletions

View File

@@ -229,10 +229,10 @@ describe("ConsoleReporter", function() {
error = new Error('After All Exception'),
anotherError = new Error('Some Other Exception');
reporter.afterAllException(error);
reporter.afterAllException(anotherError);
reporter.afterAllError(error);
reporter.afterAllError(anotherError);
reporter.jasmineDone();
expect(out.getOutput()).toMatch(/After All Exception/);
expect(out.getOutput()).toMatch(/Some Other Exception/);
});

View File

@@ -331,11 +331,11 @@ describe("Env integration", function() {
it("reports when afterAll throws an exception", function(done) {
var env = new j$.Env(),
error = new Error('After All Exception'),
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllException']);
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
reporter.jasmineDone.and.callFake(function() {
expect(reporter.afterAllException).toHaveBeenCalledWith(error);
expect(reporter.afterAllError).toHaveBeenCalledWith(error);
done();
});
@@ -356,11 +356,11 @@ describe("Env integration", function() {
it("reports when an async afterAll throws an exception", function(done) {
var env = new j$.Env(),
error = new Error('After All Exception'),
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllException']);
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
reporter.jasmineDone.and.callFake(function() {
expect(reporter.afterAllException).toHaveBeenCalledWith(error);
expect(reporter.afterAllError).toHaveBeenCalled();
done();
});
@@ -370,7 +370,7 @@ describe("Env integration", function() {
env.it('my spec', function() {
});
env.afterAll(function(done) {
env.afterAll(function(afterAllDone) {
throw error;
});
});

View File

@@ -130,7 +130,7 @@ describe("New HtmlReporter", function() {
});
});
describe("when there are afterAllExceptions", function () {
describe("when there are afterAllErrors", function () {
it("displays the exceptions in their own alert bars", function(){
var env = new j$.Env(),
container = document.createElement("div"),
@@ -147,8 +147,8 @@ describe("New HtmlReporter", function() {
reporter.initialize();
reporter.jasmineStarted({});
reporter.afterAllException(error);
reporter.afterAllException(otherError);
reporter.afterAllError(error);
reporter.afterAllError(otherError);
reporter.jasmineDone({});
var alertBars = container.querySelectorAll(".alert .bar");