I have below spec, in the afterEach, I defined a variable to verify the spec result status, and want to do something according it. After execute the the expected false spec, I found the variable didnot return the correct result.
describe('test suite', function() {
afterEach(function (done) {
var failedStatus = (this.status == 'failed');
//do sth with the variable failedStatus
console.log(failedStatus);
});
it('should be a failed', function() {
expect(false).toBe(true);
});
});
In above, I expect the failedStatus should be True, but it return False. How to correct it? Thank you.