aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/timeoutSpec.js
diff options
context:
space:
mode:
authorAli Mills2012-06-01 14:50:01 -0700
committerVojta Jina2012-06-04 17:43:14 -0700
commit1904596e0c2330299e92f092bd7a6ceca8e97c30 (patch)
tree4906472c23b2be76a743a7722d079761b3faea85 /test/ng/timeoutSpec.js
parent22143381d80482f5145e984a498a9549ad7f4e53 (diff)
downloadangular.js-1904596e0c2330299e92f092bd7a6ceca8e97c30.tar.bz2
fix($timeout): allow calling $timeout.cancel() with undefined
This is how it worked in rc9, before refactoring $defer into $timeout.
Diffstat (limited to 'test/ng/timeoutSpec.js')
-rw-r--r--test/ng/timeoutSpec.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ng/timeoutSpec.js b/test/ng/timeoutSpec.js
index 19db1227..5ee99d98 100644
--- a/test/ng/timeoutSpec.js
+++ b/test/ng/timeoutSpec.js
@@ -142,5 +142,10 @@ describe('$timeout', function() {
expect($timeout.cancel(promise1)).toBe(false);
expect($timeout.cancel(promise2)).toBe(true);
}));
+
+
+ it('should not throw a runtime exception when given an undefined promise', inject(function($timeout) {
+ expect($timeout.cancel()).toBe(false);
+ }));
});
});