Tests for nthArg, omit, omitBy
This commit is contained in:
@ -5,9 +5,14 @@ test('Testing nthArg', (t) => {
|
|||||||
//For more information on all the methods supported by tape
|
//For more information on all the methods supported by tape
|
||||||
//Please go to https://github.com/substack/tape
|
//Please go to https://github.com/substack/tape
|
||||||
t.true(typeof nthArg === 'function', 'nthArg is a Function');
|
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.deepEqual(nthArg(args..), 'Expected');
|
||||||
//t.equal(nthArg(args..), 'Expected');
|
//t.equal(nthArg(args..), 'Expected');
|
||||||
//t.false(nthArg(args..), 'Expected');
|
//t.false(nthArg(args..), 'Expected');
|
||||||
//t.throws(nthArg(args..), 'Expected');
|
//t.throws(nthArg(args..), 'Expected');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Test log for: Sun Feb 04 2018 20:47:53 GMT+0200 (GTB Standard Time)
|
Test log for: Sun Feb 04 2018 20:50:10 GMT+0200 (GTB Standard Time)
|
||||||
|
|
||||||
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
|
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
|
||||||
> tape test/**/*.test.js | tap-spec
|
> tape test/**/*.test.js | tap-spec
|
||||||
@ -993,6 +993,9 @@ Test log for: Sun Feb 04 2018 20:47:53 GMT+0200 (GTB Standard Time)
|
|||||||
Testing nthArg
|
Testing nthArg
|
||||||
|
|
||||||
√ nthArg is a Function
|
√ nthArg is a Function
|
||||||
|
√ Returns the nth argument
|
||||||
|
√ Returns undefined if arguments too few
|
||||||
|
√ Works for negative values
|
||||||
|
|
||||||
Testing nthElement
|
Testing nthElement
|
||||||
|
|
||||||
@ -1708,8 +1711,8 @@ Test log for: Sun Feb 04 2018 20:47:53 GMT+0200 (GTB Standard Time)
|
|||||||
√ Works with multiple promises
|
√ Works with multiple promises
|
||||||
|
|
||||||
|
|
||||||
total: 815
|
total: 818
|
||||||
passing: 815
|
passing: 818
|
||||||
duration: 2.4s
|
duration: 2.4s
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user