Files
30-seconds-of-code/test/composeRight/composeRight.test.js
Angelos Chalaris 3e3982a0e4 More tests
2018-01-24 17:49:09 +02:00

18 lines
699 B
JavaScript

const test = require('tape');
const composeRight = require('./composeRight.js');
test('Testing composeRight', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof composeRight === 'function', 'composeRight is a 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");
//t.deepEqual(composeRight(args..), 'Expected');
//t.equal(composeRight(args..), 'Expected');
//t.false(composeRight(args..), 'Expected');
//t.throws(composeRight(args..), 'Expected');
t.end();
});