Fixed pending() for async/promise-returning specs

Fixes #1449.
Fixes #1450.
This commit is contained in:
Steve Gravrock
2017-11-29 08:56:12 -08:00
parent 13b9e669bd
commit f4caf27208
4 changed files with 50 additions and 7 deletions

View File

@@ -1485,6 +1485,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();
@@ -1499,6 +1500,34 @@ describe("Env integration", function() {
env.execute();
});
it('should report pending spec messages from async functions', function(done) {
jasmine.getEnv().requireAsyncAwait();
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', async function() {
debugger;
env.pending('with a message');
});
env.execute();
});
it('should report using fallback reporter', function(done) {
var env = new jasmineUnderTest.Env(),
reporter = jasmine.createSpyObj('fakeReporter', [