add 2 tests, maxN & median
This commit is contained in:
@ -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');
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user