rename afterAllException to afterAllError
It should also handle expectation failures
This commit is contained in:
@@ -119,7 +119,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.afterAllException = function(error) {
|
this.afterAllError = function(error) {
|
||||||
exceptionList.push(error);
|
exceptionList.push(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -229,10 +229,10 @@ describe("ConsoleReporter", function() {
|
|||||||
error = new Error('After All Exception'),
|
error = new Error('After All Exception'),
|
||||||
anotherError = new Error('Some Other Exception');
|
anotherError = new Error('Some Other Exception');
|
||||||
|
|
||||||
reporter.afterAllException(error);
|
reporter.afterAllError(error);
|
||||||
reporter.afterAllException(anotherError);
|
reporter.afterAllError(anotherError);
|
||||||
reporter.jasmineDone();
|
reporter.jasmineDone();
|
||||||
|
|
||||||
expect(out.getOutput()).toMatch(/After All Exception/);
|
expect(out.getOutput()).toMatch(/After All Exception/);
|
||||||
expect(out.getOutput()).toMatch(/Some Other Exception/);
|
expect(out.getOutput()).toMatch(/Some Other Exception/);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -331,11 +331,11 @@ describe("Env integration", function() {
|
|||||||
it("reports when afterAll throws an exception", function(done) {
|
it("reports when afterAll throws an exception", function(done) {
|
||||||
var env = new j$.Env(),
|
var env = new j$.Env(),
|
||||||
error = new Error('After All Exception'),
|
error = new Error('After All Exception'),
|
||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllException']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
|
||||||
|
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.afterAllException).toHaveBeenCalledWith(error);
|
expect(reporter.afterAllError).toHaveBeenCalledWith(error);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -356,11 +356,11 @@ describe("Env integration", function() {
|
|||||||
it("reports when an async afterAll throws an exception", function(done) {
|
it("reports when an async afterAll throws an exception", function(done) {
|
||||||
var env = new j$.Env(),
|
var env = new j$.Env(),
|
||||||
error = new Error('After All Exception'),
|
error = new Error('After All Exception'),
|
||||||
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllException']);
|
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
|
||||||
|
|
||||||
|
|
||||||
reporter.jasmineDone.and.callFake(function() {
|
reporter.jasmineDone.and.callFake(function() {
|
||||||
expect(reporter.afterAllException).toHaveBeenCalledWith(error);
|
expect(reporter.afterAllError).toHaveBeenCalled();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ describe("Env integration", function() {
|
|||||||
env.it('my spec', function() {
|
env.it('my spec', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
env.afterAll(function(done) {
|
env.afterAll(function(afterAllDone) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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(){
|
it("displays the exceptions in their own alert bars", function(){
|
||||||
var env = new j$.Env(),
|
var env = new j$.Env(),
|
||||||
container = document.createElement("div"),
|
container = document.createElement("div"),
|
||||||
@@ -147,8 +147,8 @@ describe("New HtmlReporter", function() {
|
|||||||
reporter.initialize();
|
reporter.initialize();
|
||||||
|
|
||||||
reporter.jasmineStarted({});
|
reporter.jasmineStarted({});
|
||||||
reporter.afterAllException(error);
|
reporter.afterAllError(error);
|
||||||
reporter.afterAllException(otherError);
|
reporter.afterAllError(otherError);
|
||||||
reporter.jasmineDone({});
|
reporter.jasmineDone({});
|
||||||
|
|
||||||
var alertBars = container.querySelectorAll(".alert .bar");
|
var alertBars = container.querySelectorAll(".alert .bar");
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.afterAllException = function(error) {
|
this.afterAllError = function(error) {
|
||||||
exceptionList.push(error);
|
exceptionList.push(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
'suiteDone',
|
'suiteDone',
|
||||||
'specStarted',
|
'specStarted',
|
||||||
'specDone',
|
'specDone',
|
||||||
'afterAllException'
|
'afterAllError'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.specFilter = function() {
|
this.specFilter = function() {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
queueableFn.fn.call(self.userContext);
|
queueableFn.fn.call(self.userContext);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if(queueableFn.isAfterAll){
|
if(queueableFn.isAfterAll){
|
||||||
runner.reporter.afterAllException(e);
|
runner.reporter.afterAllError(e);
|
||||||
}
|
}
|
||||||
handleException(e);
|
handleException(e);
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
queueableFn.fn.call(self.userContext, next);
|
queueableFn.fn.call(self.userContext, next);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if(queueableFn.isAfterAll) {
|
if(queueableFn.isAfterAll) {
|
||||||
runner.reporter.afterAllException(e);
|
runner.reporter.afterAllError(e);
|
||||||
}
|
}
|
||||||
handleException(e);
|
handleException(e);
|
||||||
next();
|
next();
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|||||||
currentParent.addChild(result, 'spec');
|
currentParent.addChild(result, 'spec');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.afterAllException = function(error) {
|
this.afterAllError = function(error) {
|
||||||
exceptionList.push(error);
|
exceptionList.push(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user