mirror of
https://github.com/axios/axios.git
synced 2026-04-16 03:45:48 +08:00
13 lines
281 B
JavaScript
13 lines
281 B
JavaScript
var bind = require('../../../lib/helpers/bind');
|
|
|
|
describe('bind', function () {
|
|
it('should bind an object to a function', function () {
|
|
var o = { val: 123 };
|
|
var f = bind(function (num) {
|
|
return this.val * num;
|
|
}, o);
|
|
|
|
expect(f(2)).toEqual(246);
|
|
});
|
|
});
|