2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Fixing issue #8

This commit is contained in:
mzabriskie
2014-09-16 11:52:56 -06:00
parent 1fa35ced3c
commit 59eb2b6204
10 changed files with 50 additions and 9 deletions
+35
View File
@@ -67,4 +67,39 @@ describe('promise', function () {
expect(config.url).toEqual('/foo');
});
});
it('should support all', function () {
var fulfilled = false;
axios.all([true, 123]).then(function () {
fulfilled = true;
});
waitsFor(function () {
return fulfilled;
});
runs(function () {
expect(fulfilled).toEqual(true);
});
});
it('should support spread', function () {
var sum = 0;
var fulfilled = false;
axios.all([123, 456]).then(axios.spread(function (a, b) {
sum = a + b;
fulfilled = true;
}));
waitsFor(function () {
return fulfilled;
});
runs(function () {
expect(fulfilled).toEqual(true);
expect(sum).toEqual(123 + 456);
});
});
});