From 3ce4ac591201be9d42561812bfca051b6f5f8aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 14:36:26 +0100 Subject: [PATCH] add 2 tests, maxN & median --- test/maxN/maxN.test.js | 2 ++ test/median/median.test.js | 2 ++ test/minN/minN.test.js | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js index dfbae1441..085f54341 100644 --- a/test/maxN/maxN.test.js +++ b/test/maxN/maxN.test.js @@ -5,6 +5,8 @@ test('Testing maxN', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof maxN === 'function', 'maxN is a Function'); + t.deepEqual(maxN([1, 2, 3]), [3], "Returns the n maximum elements from the provided array"); + t.deepEqual(maxN([1, 2, 3], 2), [3, 2], "Returns the n maximum elements from the provided array"); //t.deepEqual(maxN(args..), 'Expected'); //t.equal(maxN(args..), 'Expected'); //t.false(maxN(args..), 'Expected'); diff --git a/test/median/median.test.js b/test/median/median.test.js index f55f1df78..bfb1a5cfc 100644 --- a/test/median/median.test.js +++ b/test/median/median.test.js @@ -5,6 +5,8 @@ test('Testing median', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof median === 'function', 'median is a Function'); + t.equal(median([5, 6, 50, 1, -5]), 5, "Returns the median of an array of numbers"); + t.equal(median([1, 2, 3]), 2, "Returns the median of an array of numbers"); //t.deepEqual(median(args..), 'Expected'); //t.equal(median(args..), 'Expected'); //t.false(median(args..), 'Expected'); diff --git a/test/minN/minN.test.js b/test/minN/minN.test.js index f5957f9f1..6d0460bf5 100644 --- a/test/minN/minN.test.js +++ b/test/minN/minN.test.js @@ -7,7 +7,6 @@ test('Testing minN', (t) => { t.true(typeof minN === 'function', 'minN is a Function'); t.deepEqual(minN([1, 2, 3]), [1], "Returns the n minimum elements from the provided array"); t.deepEqual(minN([1, 2, 3], 2), [1, 2], "Returns the n minimum elements from the provided array"); - //t.equal(minN(args..), 'Expected'); //t.false(minN(args..), 'Expected'); //t.throws(minN(args..), 'Expected');