test(upgrade): fix failing test in browsers which do not support RAF

closes #13399
This commit is contained in:
Marc Laval 2016-12-12 18:29:23 +01:00 committed by Victor Berchet
parent 714f2af0dd
commit d17e690eb4
1 changed files with 7 additions and 0 deletions

View File

@ -1023,6 +1023,13 @@ export function main() {
expect($onDestroySpy).toHaveBeenCalled();
ref.dispose();
if (!(global as any)['requestAnimationFrame']) {
// Needed for browser which don't support RAF and use a 16.6 setTimeout instead in
// ng1's AnimateRunner.
// This setTimeout remains at the end of the test and needs to be discarded.
tick(20);
}
});
}));