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