summaryrefslogtreecommitdiff
path: root/axios/test/specs/helpers/bind.spec.js
blob: a02c4621559eedc1b43973cb0b841e0080ef9a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);
  });
});