Tests for nthArg, omit, omitBy

This commit is contained in:
Angelos Chalaris
2018-02-04 20:53:14 +02:00
parent 873c509519
commit 2e37b6af8c
2 changed files with 12 additions and 4 deletions

View File

@ -5,9 +5,14 @@ test('Testing nthArg', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof nthArg === 'function', 'nthArg is a Function');
const third = nthArg(2);
t.equal(third(1, 2, 3), 3, 'Returns the nth argument');
t.equal(third(1, 2), undefined, 'Returns undefined if arguments too few');
const last = nthArg(-1);
t.equal(last(1, 2, 3, 4, 5), 5, 'Works for negative values');
//t.deepEqual(nthArg(args..), 'Expected');
//t.equal(nthArg(args..), 'Expected');
//t.false(nthArg(args..), 'Expected');
//t.throws(nthArg(args..), 'Expected');
t.end();
});
});