mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 10:05:34 +08:00
fix(q): resolve all of nothing to nothing
$q.all([]) no longer throws exception and resolves to empty array []
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user