From 70b44ad32a79e0746e19a74bde35f49c79f89942 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 27 Aug 2013 17:20:04 -0700 Subject: revert: fix(mocks): $timeout#flush should not update time when empty This reverts commit 42af8eada2803a54a98b4f792e60feb480d68a0c. This turned out to be a bad idea as it prevents us from moving the time forward and asserting that the component state didn't change due to the scheduled task executing too early. --- test/ngMock/angular-mocksSpec.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'test') diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js index 67fd13a1..88e1876f 100644 --- a/test/ngMock/angular-mocksSpec.js +++ b/test/ngMock/angular-mocksSpec.js @@ -404,7 +404,7 @@ describe('ngMock', function() { expect(function() {$timeout.flush(100);}).toThrow(); expect(log).toEqual(['t1']); - $timeout.flush(1000); + $timeout.flush(900); expect(log).toEqual(['t1', 't2']); expect(function() {$timeout.flush();}).toThrow(); }); @@ -425,21 +425,6 @@ describe('ngMock', function() { }); - it('should not update the current time if an exception is thrown during a flush', function() { - $timeout(log.fn('t1'), 100); - $timeout(log.fn('t2'), 101); - - expect(function() { $timeout.flush(90); }).toThrow(); - expect(function() { $timeout.flush(90); }).toThrow(); - - $timeout.flush(100); - expect(log).toEqual(['t1']); - - $timeout.flush(1); - expect(log).toEqual(['t1', 't2']); - }); - - describe('verifyNoPendingTasks', function() { it('should throw an exception when not flushed', function() { -- cgit v1.2.3