Files
30-seconds-of-code/test/partialRight/partialRight.test.js
2018-06-18 18:00:19 +03:00

14 lines
390 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');
test('Appends arguments', () => {
expect(greetJohn('Hello')).toBe('Hello John!');
});