karma-ng-scenario
karma-ng-scenario copied to clipboard
Selector failure in afterEach may trigger an infinite loop
The scenario is following:
- Spec constantly fails for some reason
- Spec failure triggers an afterEach()
- afterEach() tries to do something that requires calling an 'element' (reLogin in my case).
- element() fails
- Exception handler at angular-scenario:33243 call done() with failure for the SPEC
try {
behavior.call(self, $window, $document, done);
} catch(e) {
if (e.type && e.type === 'selector') {
done(e.message);
} else {
throw e;
}
}
- spec failure retriggers afterEach()
- loop