15 lines
384 B
JavaScript
15 lines
384 B
JavaScript
const expect = require('expect');
|
|
const partialRight = require('./partialRight.js');
|
|
|
|
|
|
test('partialRight is a Function', () => {
|
|
expect(partialRight).toBeInstanceOf(Function);
|
|
});
|
|
function greet(greeting, name) {
|
|
return greeting + ' ' + name + '!';
|
|
}
|
|
const greetJohn = partialRight(greet, 'John');
|
|
t.equal(greetJohn('Hello'), 'Hello John!', 'Appends arguments');
|
|
|
|
|