Add failing specs for expectation failures in afterAll

This commit is contained in:
Gregg Van Hove
2014-04-18 16:37:27 -07:00
parent 0d4b04d37c
commit 6066c71966

View File

@@ -328,6 +328,30 @@ describe("Env integration", function() {
env.execute();
});
it("reports when an afterAll fails an expectation", function(done) {
var env = new j$.Env(),
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
reporter.jasmineDone.and.callFake(function() {
expect(reporter.afterAllError).toHaveBeenCalled();
done();
});
env.addReporter(reporter);
env.describe('my suite', function() {
env.it('my spec', function() {
});
env.afterAll(function() {
env.expect(1).toEqual(2);
});
});
env.execute();
});
it("reports when afterAll throws an exception", function(done) {
var env = new j$.Env(),
error = new Error('After All Exception'),
@@ -353,6 +377,30 @@ describe("Env integration", function() {
env.execute();
});
it("reports when an async afterAll fails an expectation", function(done) {
var env = new j$.Env(),
reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','afterAllError']);
reporter.jasmineDone.and.callFake(function() {
expect(reporter.afterAllError).toHaveBeenCalled();
done();
});
env.addReporter(reporter);
env.describe('my suite', function() {
env.it('my spec', function() {
});
env.afterAll(function(afterAllDone) {
env.expect(1).toEqual(2);
afterAllDone();
});
});
env.execute();
});
it("reports when an async afterAll throws an exception", function(done) {
var env = new j$.Env(),
error = new Error('After All Exception'),