Merge pull request #539 from Chalarangelo/tests
[FIX: #526] Tests, update the broken ones
This commit is contained in:
@ -5,8 +5,7 @@ test('Testing anagrams', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof anagrams === 'function', 'anagrams is a Function');
|
||||
//BROKEN
|
||||
// t.deepEqual(anagrams('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all anagrams of a string");
|
||||
t.deepEqual(anagrams('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all anagrams of a string");
|
||||
//t.deepEqual(anagrams(args..), 'Expected');
|
||||
//t.equal(anagrams(args..), 'Expected');
|
||||
//t.false(anagrams(args..), 'Expected');
|
||||
|
||||
@ -5,8 +5,7 @@ test('Testing deepFlatten', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof deepFlatten === 'function', 'deepFlatten is a Function');
|
||||
//BROKEN
|
||||
// t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array");
|
||||
t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array");
|
||||
//t.deepEqual(deepFlatten(args..), 'Expected');
|
||||
//t.equal(deepFlatten(args..), 'Expected');
|
||||
//t.false(deepFlatten(args..), 'Expected');
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
module.exports = flattenDepth = (arr, depth = 1) =>
|
||||
depth != 1
|
||||
? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flattenDepth(v, depth - 1) : v), [])
|
||||
: arr.reduce((a, v) => a.concat(v), []);
|
||||
@ -1,13 +0,0 @@
|
||||
const test = require('tape');
|
||||
const flattenDepth = require('./flattenDepth.js');
|
||||
|
||||
test('Testing flattenDepth', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof flattenDepth === 'function', 'flattenDepth is a Function');
|
||||
//t.deepEqual(flattenDepth(args..), 'Expected');
|
||||
//t.equal(flattenDepth(args..), 'Expected');
|
||||
//t.false(flattenDepth(args..), 'Expected');
|
||||
//t.throws(flattenDepth(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user