Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8a59724

Browse files
committed
chore($animate): fix broken IE8 test
1 parent 35d635c commit 8a59724

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/ngAnimate/animateSpec.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,12 +1332,7 @@ describe("ngAnimate", function() {
13321332
}));
13331333

13341334
it("should intelligently cancel former timeouts and close off a series of elements a final timeout", function() {
1335-
var currentTimestamp = Date.now();
1336-
spyOn(Date,'now').andCallFake(function() {
1337-
return currentTimestamp;
1338-
});
1339-
1340-
var cancellations = 0;
1335+
var currentTimestamp, cancellations = 0;
13411336
module(function($provide) {
13421337
$provide.decorator('$timeout', function($delegate) {
13431338
var _cancel = $delegate.cancel;
@@ -1349,6 +1344,15 @@ describe("ngAnimate", function() {
13491344
};
13501345
return $delegate;
13511346
});
1347+
1348+
return function($sniffer) {
1349+
if($sniffer.transitions) {
1350+
currentTimestamp = Date.now();
1351+
spyOn(Date,'now').andCallFake(function() {
1352+
return currentTimestamp;
1353+
});
1354+
}
1355+
}
13521356
})
13531357
inject(function($animate, $rootScope, $compile, $sniffer, $timeout) {
13541358
if (!$sniffer.transitions) return;

0 commit comments

Comments
 (0)