Merge branch 'master' into 3.0-features

This commit is contained in:
Steve Gravrock
2017-12-18 09:48:17 -08:00
9 changed files with 167 additions and 31 deletions

View File

@@ -1530,6 +1530,7 @@ describe("Env integration", function() {
reporter.jasmineDone.and.callFake(function() {
var specStatus = reporter.specDone.calls.argsFor(0)[0];
expect(specStatus.status).toBe('pending');
expect(specStatus.pendingReason).toBe('with a message');
done();
@@ -1544,6 +1545,45 @@ describe("Env integration", function() {
env.execute();
});
it('should report pending spec messages from promise-returning functions', function(done) {
function StubPromise(fn) {
try {
fn();
} catch (e) {
this.exception = e;
}
}
StubPromise.prototype.then = function(resolve, reject) {
reject(this.exception);
};
var env = new jasmineUnderTest.Env(),
reporter = jasmine.createSpyObj('fakeReporter', [
'specDone',
'jasmineDone'
]);
reporter.jasmineDone.and.callFake(function() {
var specStatus = reporter.specDone.calls.argsFor(0)[0];
expect(specStatus.status).toBe('pending');
expect(specStatus.pendingReason).toBe('with a message');
done();
});
env.addReporter(reporter);
env.it('will be pending', function() {
return new StubPromise(function() {
env.pending('with a message');
});
});
env.execute();
});
it('should report using fallback reporter', function(done) {
var env = new jasmineUnderTest.Env(),
reporter = jasmine.createSpyObj('fakeReporter', [