angular/jasminewd

returning promise.rejected(); is not finishing IT( )

Opened this issue · 0 comments

could you confirm if there is any workaround to fix this:

when i try this

describe('desc1', () => {
  it('it1', () => {
    return promise.when(true);
  });
});

test complete without problem, but if i try rejecting like this

describe('desc1', () => {
  it('it1', () => {
    return promise.rejected();
  });
});

test freeze until jasmine timeout happen. i think jasminewd internally is executing done.fail but is not enough to finish this IT so test hungs.

this is happening when

jasmine.getEnv().throwOnExpectationFailure(true);

as hot fix tried using then(done,done) but missing errors, so opted disabling throwOnExpectationFailure and wrap expectations inside my own helper. (also with benefit of fixing stack missed by jasmine at expectations.)

think is related to jasmine/jasmine#1213
and this angular/protractor#3234
and this jasmine/jasmine#529
etc (multiples issues associated)

seems a jasmine bug to me but anyway would be very useful if you can create a workaround. thank you.