Files
30-seconds-of-code/test/bindAll/bindAll.test.js
Angelos Chalaris 06d7e04220 Added some tests
2018-01-28 16:28:54 +02:00

22 lines
675 B
JavaScript

const test = require('tape');
const bindAll = require('./bindAll.js');
test('Testing bindAll', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof bindAll === 'function', 'bindAll is a Function');
var view = {
label: 'docs',
'click': function() {
return 'clicked ' + this.label;
}
}
bindAll(view, 'click');
t.equal(view.click(), 'clicked docs', 'Binds to an object context')
//t.deepEqual(bindAll(args..), 'Expected');
//t.equal(bindAll(args..), 'Expected');
//t.false(bindAll(args..), 'Expected');
//t.throws(bindAll(args..), 'Expected');
t.end();
});