Travis build: 1358 [cron]
This commit is contained in:
5
test/findLastKey/findLastKey.js
Normal file
5
test/findLastKey/findLastKey.js
Normal file
@ -0,0 +1,5 @@
|
||||
const findLastKey = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.reverse()
|
||||
.find(key => fn(obj[key], key, obj));
|
||||
module.exports = findLastKey
|
||||
13
test/findLastKey/findLastKey.test.js
Normal file
13
test/findLastKey/findLastKey.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const findLastKey = require('./findLastKey.js');
|
||||
|
||||
test('Testing findLastKey', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof findLastKey === 'function', 'findLastKey is a Function');
|
||||
//t.deepEqual(findLastKey(args..), 'Expected');
|
||||
//t.equal(findLastKey(args..), 'Expected');
|
||||
//t.false(findLastKey(args..), 'Expected');
|
||||
//t.throws(findLastKey(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user