diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js index 47e035791..8869354da 100644 --- a/test/cleanObj/cleanObj.test.js +++ b/test/cleanObj/cleanObj.test.js @@ -5,6 +5,8 @@ test('Testing cleanObj', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof cleanObj === 'function', 'cleanObj is a Function'); + const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; + t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object"); //t.deepEqual(cleanObj(args..), 'Expected'); //t.equal(cleanObj(args..), 'Expected'); //t.false(cleanObj(args..), 'Expected'); diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js index 1271e74ff..a8014b100 100644 --- a/test/curry/curry.test.js +++ b/test/curry/curry.test.js @@ -5,8 +5,8 @@ test('Testing curry', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof curry === 'function', 'curry is a Function'); - //BROKEN - // t.equal(curry(Math.pow)(2)(10), 1024, "Curries a function"); + t.equal(curry(Math.pow)(2)(10), 1024, "curries a Math.pow"); + t.equal(curry(Math.min, 3)(10)(50)(2), 2, "curries a Math.min"); //t.deepEqual(curry(args..), 'Expected'); //t.equal(curry(args..), 'Expected'); //t.false(curry(args..), 'Expected'); diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js index a86587170..b425f7fb1 100644 --- a/test/elo/elo.test.js +++ b/test/elo/elo.test.js @@ -4,11 +4,10 @@ const elo = require('./elo.js'); test('Testing elo', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape - // BORKEN - // t.true(typeof elo === 'function', 'elo is a Function'); - // t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s"); - // t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s"; - // t.deepEqual(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185, 1154], "4 player FFA, all same rank"); + t.true(typeof elo === 'function', 'elo is a Function'); + t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s"); + t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s"; + t.deepEqual(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185, 1154], "4 player FFA, all same rank"); //t.deepEqual(elo(args..), 'Expected'); //t.equal(elo(args..), 'Expected'); //t.false(elo(args..), 'Expected'); diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js index 6b67865ea..6eb4467ff 100644 --- a/test/factorial/factorial.test.js +++ b/test/factorial/factorial.test.js @@ -5,7 +5,11 @@ test('Testing factorial', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof factorial === 'function', 'factorial is a Function'); - // t.equal(factorial(6), 720, "Calculates the factorial of a number"); DOESN'T WORK + t.equal(factorial(6), 720, "Calculates the factorial of 720"); + t.equal(factorial(0), 1, "Calculates the factorial of 0"); + t.equal(factorial(1), 1, "Calculates the factorial of 1"); + t.equal(factorial(4), 24, "Calculates the factorial of 4"); + t.equal(factorial(10), 3628800, "Calculates the factorial of 10"); //t.deepEqual(factorial(args..), 'Expected'); //t.equal(factorial(args..), 'Expected'); //t.false(factorial(args..), 'Expected');