diff --git a/snippets/collectInto.md b/snippets/collectInto.md index 3da1173bd..da37626a2 100644 --- a/snippets/collectInto.md +++ b/snippets/collectInto.md @@ -13,5 +13,5 @@ const Pall = collectInto(Promise.all.bind(Promise)); let p1 = Promise.resolve(1); let p2 = Promise.resolve(2); let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); -Pall(p1, p2, p3).then(console.log); +Pall(p1, p2, p3).then(console.log); // [1, 2, 3] (after about 2 seconds) ``` diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js index a3d303e5a..557134336 100644 --- a/test/collectInto/collectInto.test.js +++ b/test/collectInto/collectInto.test.js @@ -5,9 +5,14 @@ test('Testing collectInto', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof collectInto === 'function', 'collectInto is a Function'); + const Pall = collectInto(Promise.all.bind(Promise)); + let p1 = Promise.resolve(1); + let p2 = Promise.resolve(2); + let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); + Pall(p1, p2, p3).then(function(val){ t.deepEqual(val, [1,2,3], 'Works with multiple promises')}, function(reason){}); //t.deepEqual(collectInto(args..), 'Expected'); //t.equal(collectInto(args..), 'Expected'); //t.false(collectInto(args..), 'Expected'); //t.throws(collectInto(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index ea6c3b748..94296d017 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -5,9 +5,11 @@ test('Testing countBy', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof countBy === 'function', 'countBy is a Function'); + t.deepEqual(countBy([6.1, 4.2, 6.3], Math.floor), {4: 1, 6: 2}, 'Works for functions'); + t.deepEqual(countBy(['one', 'two', 'three'], 'length'), {3: 2, 5: 1}, 'Works for property names'); //t.deepEqual(countBy(args..), 'Expected'); //t.equal(countBy(args..), 'Expected'); //t.false(countBy(args..), 'Expected'); //t.throws(countBy(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index c18264447..83bf6b32a 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -5,9 +5,11 @@ test('Testing decapitalize', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof decapitalize === 'function', 'decapitalize is a Function'); + t.equal(decapitalize('FooBar'), 'fooBar', 'Works with default parameter'); + t.equal(decapitalize('FooBar', true), 'fOOBAR', 'Works with second parameter set to true'); //t.deepEqual(decapitalize(args..), 'Expected'); //t.equal(decapitalize(args..), 'Expected'); //t.false(decapitalize(args..), 'Expected'); //t.throws(decapitalize(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/testlog b/test/testlog index 9c0f4f3cb..34922d51d 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sun Jan 28 2018 16:28:45 GMT+0200 (GTB Standard Time) +Test log for: Sun Jan 28 2018 16:40:59 GMT+0200 (GTB Standard Time) > 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -186,6 +186,8 @@ Test log for: Sun Jan 28 2018 16:28:45 GMT+0200 (GTB Standard Time) Testing countBy √ countBy is a Function + √ Works for functions + √ Works for property names Testing countOccurrences @@ -221,6 +223,8 @@ Test log for: Sun Jan 28 2018 16:28:45 GMT+0200 (GTB Standard Time) Testing decapitalize √ decapitalize is a Function + √ Works with default parameter + √ Works with second parameter set to true Testing deepClone @@ -1601,10 +1605,11 @@ Test log for: Sun Jan 28 2018 16:28:45 GMT+0200 (GTB Standard Time) Testing zipWith √ zipWith is a Function + √ Works with multiple promises - total: 716 - passing: 716 - duration: 1.1s + total: 721 + passing: 721 + duration: 3.1s