mirror of
https://github.com/tenrok/axios.git
synced 2026-05-18 12:39:44 +03:00
a130e787c3
returning the result of the callback allows you to chain the promise like you would expect
22 lines
449 B
JavaScript
22 lines
449 B
JavaScript
var spread = require('../../../lib/helpers/spread');
|
|
|
|
describe('helpers::spread', function () {
|
|
it('should spread array to arguments', function () {
|
|
var value = 0;
|
|
spread(function (a, b) {
|
|
value = a * b;
|
|
})([5, 10]);
|
|
|
|
expect(value).toEqual(50);
|
|
});
|
|
|
|
it('should return callback result', function () {
|
|
var value = spread(function (a, b) {
|
|
return a * b;
|
|
})([5, 10]);
|
|
|
|
expect(value).toEqual(50);
|
|
});
|
|
});
|
|
|