aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngMock/angular-mocksSpec.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-07-23 23:45:21 -0400
committerIgor Minar2013-07-26 08:56:41 -0700
commitb7fdabc4bf2a9dd11a57f98c5229d834c4589bab (patch)
treecda74760e8142e60b515afe4e395e8ff8e84b79c /test/ngMock/angular-mocksSpec.js
parent258cae83dc1a03b6b878a7b4236c499288cd2624 (diff)
downloadangular.js-b7fdabc4bf2a9dd11a57f98c5229d834c4589bab.tar.bz2
feat(ngMock): support delay limit for $timeout.flush
Diffstat (limited to 'test/ngMock/angular-mocksSpec.js')
-rw-r--r--test/ngMock/angular-mocksSpec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js
index 4e17dfb2..37bf001a 100644
--- a/test/ngMock/angular-mocksSpec.js
+++ b/test/ngMock/angular-mocksSpec.js
@@ -351,6 +351,20 @@ describe('ngMock', function() {
$timeout.flush();
expect(function() {$timeout.verifyNoPendingTasks();}).not.toThrow();
}));
+
+
+ it('should check against the delay if provided within timeout', inject(function($timeout) {
+ $timeout(noop, 100);
+ $timeout.flush(100);
+ expect(function() {$timeout.verifyNoPendingTasks();}).not.toThrow();
+
+ $timeout(noop, 1000);
+ $timeout.flush(100);
+ expect(function() {$timeout.verifyNoPendingTasks();}).toThrow();
+
+ $timeout.flush(900);
+ expect(function() {$timeout.verifyNoPendingTasks();}).not.toThrow();
+ }));
});