-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
29 lines (20 loc) · 1.88 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
var _assert = require('assert');
var _assert2 = _interopRequireWildcard(_assert);
var _bind = require('./');
var _bind2 = _interopRequireWildcard(_bind);
it('fj-bind', function () {
var context = {
foo: 'bar'
};
function moo() {
return this.foo;
}
function mooWithArgs(a, b) {
return this.foo + a + b;
}
_assert2['default'].equal(_bind2['default'](context)(moo)(), 'bar');
_assert2['default'].equal(_bind2['default'](context)(mooWithArgs)(1, 2), 'bar12');
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7c0JBQW1CLFFBQVE7Ozs7b0JBQ1YsSUFBSTs7OztBQUdyQixFQUFFLENBQUMsU0FBUyxFQUFFLFlBQU07QUFDbEIsTUFBSSxPQUFPLEdBQUc7QUFDWixPQUFHLEVBQUUsS0FBSztHQUNYLENBQUM7O0FBRUYsV0FBUyxHQUFHLEdBQUc7QUFDYixXQUFPLElBQUksQ0FBQyxHQUFHLENBQUM7R0FDakI7O0FBRUQsV0FBUyxXQUFXLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRTtBQUN6QixXQUFPLElBQUksQ0FBQyxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQztHQUN6Qjs7QUFFRCxzQkFBTyxLQUFLLENBQUMsa0JBQUssT0FBTyxDQUFDLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxLQUFLLENBQUMsQ0FBQztBQUMxQyxzQkFBTyxLQUFLLENBQUMsa0JBQUssT0FBTyxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxFQUFFLEN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