aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2012-03-23 13:31:20 -0700
committerMisko Hevery2012-03-23 14:21:43 -0700
commitac75079e2113949d5d64adbcf23d56f3cf295d41 (patch)
tree7956bcbd50de73755d599b624677666e20419595 /test
parent5390fb37d2c01937922613fc57df4986af521787 (diff)
downloadangular.js-ac75079e2113949d5d64adbcf23d56f3cf295d41.tar.bz2
fix(q): resolve all of nothing to nothing
$q.all([]) no longer throws exception and resolves to empty array []
Diffstat (limited to 'test')
-rw-r--r--test/service/qSpec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/service/qSpec.js b/test/service/qSpec.js
index e592ab87..a230d1de 100644
--- a/test/service/qSpec.js
+++ b/test/service/qSpec.js
@@ -676,6 +676,14 @@ describe('q', function() {
describe('all', function() {
+ it('should resolve all of nothing', function() {
+ var result;
+ q.all([]).then(function(r) { result = r; });
+ mockNextTick.flush();
+ expect(result).toEqual([]);
+ });
+
+
it('should take an array of promises and return a promise for an array of results', function() {
var deferred1 = defer(),
deferred2 = defer();