Add any, anyBy, all, allBy, none, noneBy
This commit is contained in:
2
test/anyBy/anyBy.js
Normal file
2
test/anyBy/anyBy.js
Normal file
@ -0,0 +1,2 @@
|
||||
const anyBy = (arr, fn) => arr.some(fn);
|
||||
module.exports = anyBy;
|
||||
15
test/anyBy/anyBy.test.js
Normal file
15
test/anyBy/anyBy.test.js
Normal file
@ -0,0 +1,15 @@
|
||||
const test = require('tape');
|
||||
const anyBy = require('./anyBy.js');
|
||||
|
||||
test('Testing anyBy', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof anyBy === 'function', 'anyBy is a Function');
|
||||
t.true(anyBy([4,1,0,3], x => x >= 1), 'Returns true with predicate function');
|
||||
t.false(anyBy([0,1], x => x < 0), 'Returns false with a predicate function');
|
||||
//t.deepEqual(anyBy(args..), 'Expected');
|
||||
//t.equal(anyBy(args..), 'Expected');
|
||||
//t.false(anyBy(args..), 'Expected');
|
||||
//t.throws(anyBy(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user