From d17e690eb4b1652e028d8b1b7839c7b2b9cced66 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Mon, 12 Dec 2016 18:29:23 +0100 Subject: [PATCH] test(upgrade): fix failing test in browsers which do not support RAF closes #13399 --- modules/@angular/upgrade/test/upgrade_spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/@angular/upgrade/test/upgrade_spec.ts b/modules/@angular/upgrade/test/upgrade_spec.ts index 90f21c510c..6f4354b1be 100644 --- a/modules/@angular/upgrade/test/upgrade_spec.ts +++ b/modules/@angular/upgrade/test/upgrade_spec.ts @@ -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); + } }); }));