Test cleanup and fixes [c-d]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:34:04 +03:00
parent d29974ebc9
commit 105185c213
136 changed files with 805 additions and 484 deletions

View File

@ -1,13 +1,12 @@
const expect = require('expect');
const composeRight = require('./composeRight.js');
test('composeRight is a Function', () => {
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");
const add = (x, y) => x + y;
const square = x => x * x;
const addAndSquare = composeRight(add, square);
test('Performs left-to-right function composition', () => {
expect(addAndSquare(1, 2)).toBe(9);
});