Travis build: 1738 [custom]

This commit is contained in:
30secondsofcode
2018-02-26 10:20:51 +00:00
parent c0a299ae3e
commit 11f3d95379
4 changed files with 29 additions and 6 deletions

5
test/nest/nest.js Normal file
View File

@ -0,0 +1,5 @@
const nest = (items, id = null, link = 'parent_id') =>
items
.filter(item => item[link] === id)
.map(item => ({ ...item, children: nest(items, item.id) }));
module.exports = nest;

13
test/nest/nest.test.js Normal file
View File

@ -0,0 +1,13 @@
const test = require('tape');
const nest = require('./nest.js');
test('Testing nest', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof nest === 'function', 'nest is a Function');
//t.deepEqual(nest(args..), 'Expected');
//t.equal(nest(args..), 'Expected');
//t.false(nest(args..), 'Expected');
//t.throws(nest(args..), 'Expected');
t.end();
});