Files
30-seconds-of-code/test/composeRight/composeRight.test.js
Angelos Chalaris 4f7da1be9b Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

14 lines
380 B
JavaScript

const expect = require('expect');
const composeRight = require('./composeRight.js');
test('composeRight is a Function', () => {
expect(composeRight).toBeInstanceOf(Function);
});
const add = (x, y) => x + y;
const square = x => x * x;
const addAndSquare = composeRight(add, square);
t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition");