From db1648d08ca55889f544872d0692ce8c3089c14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 17:44:26 +0100 Subject: [PATCH] add 2 tests, compose and countOccurences --- test/compose/compose.test.js | 4 ++++ test/countOccurrences/countOccurrences.test.js | 1 + 2 files changed, 5 insertions(+) diff --git a/test/compose/compose.test.js b/test/compose/compose.test.js index 11593b563..97d0304bc 100644 --- a/test/compose/compose.test.js +++ b/test/compose/compose.test.js @@ -5,6 +5,10 @@ test('Testing compose', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof compose === 'function', 'compose is a Function'); + const add5 = x => x + 5; + const multiply = (x, y) => x * y; + const multiplyAndAdd5 = compose(add5, multiply); + t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition"); //t.deepEqual(compose(args..), 'Expected'); //t.equal(compose(args..), 'Expected'); //t.false(compose(args..), 'Expected'); diff --git a/test/countOccurrences/countOccurrences.test.js b/test/countOccurrences/countOccurrences.test.js index 64b2d14c4..1f160ff52 100644 --- a/test/countOccurrences/countOccurrences.test.js +++ b/test/countOccurrences/countOccurrences.test.js @@ -5,6 +5,7 @@ test('Testing countOccurrences', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof countOccurrences === 'function', 'countOccurrences is a Function'); + t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array"); //t.deepEqual(countOccurrences(args..), 'Expected'); //t.equal(countOccurrences(args..), 'Expected'); //t.false(countOccurrences(args..), 'Expected');