Update drop, add dropWhile, dropRightWhile

This commit is contained in:
Angelos Chalaris
2018-01-26 12:23:18 +02:00
parent 49b1fc7947
commit aea334a94a
14 changed files with 65 additions and 31 deletions

View File

@ -1,14 +1,14 @@
const test = require('tape');
const dropElements = require('./dropElements.js');
const dropWhile = require('./dropWhile.js');
test('Testing dropElements', (t) => {
test('Testing dropWhile', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof dropElements === 'function', 'dropElements is a Function');
t.deepEqual(dropElements([1, 2, 3, 4], n => n >= 3), [3,4], "Removes elements in an array until the passed function returns true");
//t.deepEqual(dropElements(args..), 'Expected');
//t.equal(dropElements(args..), 'Expected');
//t.false(dropElements(args..), 'Expected');
//t.throws(dropElements(args..), 'Expected');
t.true(typeof dropWhile === 'function', 'dropWhile is a Function');
t.deepEqual(dropWhile([1, 2, 3, 4], n => n >= 3), [3,4], "Removes elements in an array until the passed function returns true");
//t.deepEqual(dropWhile(args..), 'Expected');
//t.equal(dropWhile(args..), 'Expected');
//t.false(dropWhile(args..), 'Expected');
//t.throws(dropWhile(args..), 'Expected');
t.end();
});