diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js index 25991568f..e5cbedefc 100644 --- a/test/flip/flip.test.js +++ b/test/flip/flip.test.js @@ -5,9 +5,14 @@ test('Testing flip', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof flip === 'function', 'flip is a Function'); + let a = { name: 'John Smith' }; + let b = {}; + const mergeFrom = flip(Object.assign); + let mergePerson = mergeFrom.bind(null, a); + t.deepEqual(mergePerson(b), a, 'Flips argument order'); //t.deepEqual(flip(args..), 'Expected'); //t.equal(flip(args..), 'Expected'); //t.false(flip(args..), 'Expected'); //t.throws(flip(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/over/over.test.js b/test/over/over.test.js index e7ef99156..c349f6049 100644 --- a/test/over/over.test.js +++ b/test/over/over.test.js @@ -5,9 +5,11 @@ test('Testing over', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof over === 'function', 'over is a Function'); + const minMax = over(Math.min, Math.max); + t.deepEqual(minMax(1, 2, 3, 4, 5), [1,5], 'Applies given functions over multiple arguments'); //t.deepEqual(over(args..), 'Expected'); //t.equal(over(args..), 'Expected'); //t.false(over(args..), 'Expected'); //t.throws(over(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/overArgs/overArgs.test.js b/test/overArgs/overArgs.test.js index 81c194c90..523cf3ff2 100644 --- a/test/overArgs/overArgs.test.js +++ b/test/overArgs/overArgs.test.js @@ -5,9 +5,13 @@ test('Testing overArgs', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof overArgs === 'function', 'overArgs is a Function'); + const square = n => n * n; + const double = n => n * 2; + const fn = overArgs((x, y) => [x, y], [square, double]); + t.deepEqual(fn(9, 3), [81, 6], 'Invokes the provided function with its arguments transformed'); //t.deepEqual(overArgs(args..), 'Expected'); //t.equal(overArgs(args..), 'Expected'); //t.false(overArgs(args..), 'Expected'); //t.throws(overArgs(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js index b6255bfad..a9703858f 100644 --- a/test/pipeFunctions/pipeFunctions.test.js +++ b/test/pipeFunctions/pipeFunctions.test.js @@ -5,9 +5,13 @@ test('Testing pipeFunctions', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof pipeFunctions === 'function', 'pipeFunctions is a Function'); + const add5 = x => x + 5; + const multiply = (x, y) => x * y; + const multiplyAndAdd5 = pipeFunctions(multiply, add5); + t.equal(multiplyAndAdd5(5, 2), 15, 'Performs left-to-right function composition'); //t.deepEqual(pipeFunctions(args..), 'Expected'); //t.equal(pipeFunctions(args..), 'Expected'); //t.false(pipeFunctions(args..), 'Expected'); //t.throws(pipeFunctions(args..), 'Expected'); t.end(); -}); \ No newline at end of file +}); diff --git a/test/testlog b/test/testlog index 7d47193fe..4e3434342 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sun Feb 04 2018 16:47:24 GMT+0200 (GTB Standard Time) +Test log for: Sun Feb 04 2018 16:54:16 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 @@ -409,6 +409,7 @@ Test log for: Sun Feb 04 2018 16:47:24 GMT+0200 (GTB Standard Time) Testing flip √ flip is a Function + √ Flips argument order Testing forEachRight @@ -1044,10 +1045,12 @@ Test log for: Sun Feb 04 2018 16:47:24 GMT+0200 (GTB Standard Time) Testing over √ over is a Function + √ Applies given functions over multiple arguments Testing overArgs √ overArgs is a Function + √ Invokes the provided function with its arguments transformed Testing palindrome @@ -1095,6 +1098,7 @@ Test log for: Sun Feb 04 2018 16:47:24 GMT+0200 (GTB Standard Time) Testing pipeFunctions √ pipeFunctions is a Function + √ Performs left-to-right function composition Testing pluralize @@ -1701,8 +1705,8 @@ Test log for: Sun Feb 04 2018 16:47:24 GMT+0200 (GTB Standard Time) √ Works with multiple promises - total: 805 - passing: 805 + total: 809 + passing: 809 duration: 2.4s