aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2013-08-27 17:20:04 -0700
committerIgor Minar2013-08-27 17:21:11 -0700
commit70b44ad32a79e0746e19a74bde35f49c79f89942 (patch)
treebaf790034b8e7fd604656272072a550d6033d4c5 /test
parent0f56cfdd13b86c1d98a08a90715850b34bb46fde (diff)
downloadangular.js-70b44ad32a79e0746e19a74bde35f49c79f89942.tar.bz2
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.
Diffstat (limited to 'test')
-rw-r--r--test/ngMock/angular-mocksSpec.js17
1 files changed, 1 insertions, 16 deletions
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() {