ran npm run tester -> logged invertKeyValues test are invalid
This commit is contained in:
6
test/findLastIndex/findLastIndex.js
Normal file
6
test/findLastIndex/findLastIndex.js
Normal file
@ -0,0 +1,6 @@
|
||||
const findLastIndex = (arr, fn) =>
|
||||
arr
|
||||
.map((val, i) => [i, val])
|
||||
.filter(val => fn(val[1], val[0], arr))
|
||||
.slice(-1)[0][0];
|
||||
module.exports = findLastIndex
|
||||
13
test/findLastIndex/findLastIndex.test.js
Normal file
13
test/findLastIndex/findLastIndex.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const findLastIndex = require('./findLastIndex.js');
|
||||
|
||||
test('Testing findLastIndex', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof findLastIndex === 'function', 'findLastIndex is a Function');
|
||||
//t.deepEqual(findLastIndex(args..), 'Expected');
|
||||
//t.equal(findLastIndex(args..), 'Expected');
|
||||
//t.false(findLastIndex(args..), 'Expected');
|
||||
//t.throws(findLastIndex(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user