Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 908ab52

Browse files
committed
chore($animate): fix broken IE8 test
1 parent ff5cf73 commit 908ab52

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
@@ -1390,12 +1390,7 @@ describe("ngAnimate", function() {
13901390
}));
13911391

13921392
it("should intelligently cancel former timeouts and close off a series of elements a final timeout", function() {
1393-
var currentTimestamp = Date.now();
1394-
spyOn(Date,'now').andCallFake(function() {
1395-
return currentTimestamp;
1396-
});
1397-
1398-
var cancellations = 0;
1393+
var currentTimestamp, cancellations = 0;
13991394
module(function($provide) {
14001395
$provide.decorator('$timeout', function($delegate) {
14011396
var _cancel = $delegate.cancel;
@@ -1407,6 +1402,15 @@ describe("ngAnimate", function() {
14071402
};
14081403
return $delegate;
14091404
});
1405+
1406+
return function($sniffer) {
1407+
if($sniffer.transitions) {
1408+
currentTimestamp = Date.now();
1409+
spyOn(Date,'now').andCallFake(function() {
1410+
return currentTimestamp;
1411+
});
1412+
}
1413+
}
14101414
})
14111415
inject(function($animate, $rootScope, $compile, $sniffer, $timeout) {
14121416
if (!$sniffer.transitions) return;

0 commit comments

Comments
 (0)