Move explicit fail spec out of mock clock context and re-add the afterAll for IEs
This commit is contained in:
@@ -1117,11 +1117,15 @@ describe("Env integration", function() {
|
|||||||
jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||||
|
|
||||||
env.describe('suite', function() {
|
env.describe('suite', function() {
|
||||||
// env.afterAll(function() {
|
env.afterAll(function() {
|
||||||
// realSetTimeout(function() {
|
realSetTimeout(function() {
|
||||||
// jasmine.clock().tick(10);
|
try {
|
||||||
// }, 100);
|
jasmine.clock().tick(10);
|
||||||
// });
|
} catch(e) {
|
||||||
|
// don't worry if the clock is already uninstalled
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
env.describe('beforeAll', function() {
|
env.describe('beforeAll', function() {
|
||||||
env.beforeAll(function(innerDone) {
|
env.beforeAll(function(innerDone) {
|
||||||
realSetTimeout(function() {
|
realSetTimeout(function() {
|
||||||
@@ -1191,93 +1195,71 @@ describe("Env integration", function() {
|
|||||||
|
|
||||||
env.execute();
|
env.execute();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('explicitly fails an async spec', function(done) {
|
it('explicitly fails an async spec', function(done) {
|
||||||
var env = new jasmineUnderTest.Env(),
|
var env = new jasmineUnderTest.Env(),
|
||||||
specDone = jasmine.createSpy('specDone');
|
specDone = jasmine.createSpy('specDone');
|
||||||
|
|
||||||
specDone.and.callFake(function() {
|
env.addReporter({
|
||||||
realSetTimeout(function() {
|
specDone: specDone,
|
||||||
jasmine.clock().tick(1);
|
jasmineDone: function() {
|
||||||
}, 0);
|
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a default message',
|
||||||
});
|
['Failed']
|
||||||
|
);
|
||||||
|
expect(specDone).toHaveFailedExpectationsForRunnable('failing specifies a message',
|
||||||
|
['Failed: messy message']
|
||||||
|
);
|
||||||
|
expect(specDone).toHaveFailedExpectationsForRunnable('failing fails via the done callback',
|
||||||
|
['Failed: done failed']
|
||||||
|
);
|
||||||
|
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a message from an Error',
|
||||||
|
['Failed: error message']
|
||||||
|
);
|
||||||
|
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a message from an Error to done',
|
||||||
|
['Failed: done error']
|
||||||
|
);
|
||||||
|
|
||||||
env.addReporter({
|
setTimeout(done);
|
||||||
specDone: specDone,
|
}
|
||||||
jasmineDone: function() {
|
|
||||||
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a default message',
|
|
||||||
['Failed']
|
|
||||||
);
|
|
||||||
expect(specDone).toHaveFailedExpectationsForRunnable('failing specifies a message',
|
|
||||||
['Failed: messy message']
|
|
||||||
);
|
|
||||||
expect(specDone).toHaveFailedExpectationsForRunnable('failing fails via the done callback',
|
|
||||||
['Failed: done failed']
|
|
||||||
);
|
|
||||||
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a message from an Error',
|
|
||||||
['Failed: error message']
|
|
||||||
);
|
|
||||||
expect(specDone).toHaveFailedExpectationsForRunnable('failing has a message from an Error to done',
|
|
||||||
['Failed: done error']
|
|
||||||
);
|
|
||||||
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
realSetTimeout(done);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
env.describe('failing', function() {
|
|
||||||
env.it('has a default message', function(innerDone) {
|
|
||||||
setTimeout(function() {
|
|
||||||
env.fail();
|
|
||||||
innerDone();
|
|
||||||
}, 1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
env.it('specifies a message', function(innerDone) {
|
|
||||||
setTimeout(function() {
|
|
||||||
env.fail('messy message');
|
|
||||||
innerDone();
|
|
||||||
}, 1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
env.it('fails via the done callback', function(innerDone) {
|
|
||||||
setTimeout(function() {
|
|
||||||
innerDone.fail('done failed');
|
|
||||||
}, 1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
env.it('has a message from an Error', function(innerDone) {
|
|
||||||
setTimeout(function() {
|
|
||||||
env.fail(new Error('error message'));
|
|
||||||
innerDone();
|
|
||||||
}, 1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
env.it('has a message from an Error to done', function(innerDone) {
|
|
||||||
setTimeout(function() {
|
|
||||||
innerDone(new Error('done error'));
|
|
||||||
}, 1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
jasmine.clock().tick(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
env.execute();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
env.describe('failing', function() {
|
||||||
|
env.it('has a default message', function(innerDone) {
|
||||||
|
setTimeout(function() {
|
||||||
|
env.fail();
|
||||||
|
innerDone();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
env.it('specifies a message', function(innerDone) {
|
||||||
|
setTimeout(function() {
|
||||||
|
env.fail('messy message');
|
||||||
|
innerDone();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
env.it('fails via the done callback', function(innerDone) {
|
||||||
|
setTimeout(function() {
|
||||||
|
innerDone.fail('done failed');
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
env.it('has a message from an Error', function(innerDone) {
|
||||||
|
setTimeout(function() {
|
||||||
|
env.fail(new Error('error message'));
|
||||||
|
innerDone();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
env.it('has a message from an Error to done', function(innerDone) {
|
||||||
|
setTimeout(function() {
|
||||||
|
innerDone(new Error('done error'));
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
env.execute();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('focused tests', function() {
|
describe('focused tests', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user