diff --git a/snippets/luhnCheck.md b/snippets/luhnCheck.md index 9f931662a..69b09b113 100644 --- a/snippets/luhnCheck.md +++ b/snippets/luhnCheck.md @@ -23,6 +23,6 @@ const luhnCheck = num => { ```js luhnCheck('4485275742308327'); // true -luhnCheck(6011329933655299); // true +luhnCheck(6011329933655299); // false luhnCheck(123456789); // false ``` diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js index 856cf427c..b53fe9c36 100644 --- a/test/luhnCheck/luhnCheck.test.js +++ b/test/luhnCheck/luhnCheck.test.js @@ -5,6 +5,9 @@ test('Testing luhnCheck', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof luhnCheck === 'function', 'luhnCheck is a Function'); + t.equal(luhnCheck(6011329933655299), false, "validates identification number"); + t.equal(luhnCheck('4485275742308327'), true, "validates identification number"); + t.equal(luhnCheck(123456789), false, "validates identification number"); //t.deepEqual(luhnCheck(args..), 'Expected'); //t.equal(luhnCheck(args..), 'Expected'); //t.false(luhnCheck(args..), 'Expected'); diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js index bc853fcb0..d534b43b0 100644 --- a/test/mapObject/mapObject.test.js +++ b/test/mapObject/mapObject.test.js @@ -5,6 +5,8 @@ test('Testing mapObject', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof mapObject === 'function', 'mapObject is a Function'); + const squareIt = arr => mapObject(arr, a => a * a); + t.deepEqual(squareIt([1, 2, 3]), { 1: 1, 2: 4, 3: 9 }, "Maps the values of an array to an object using a function"); //t.deepEqual(mapObject(args..), 'Expected'); //t.equal(mapObject(args..), 'Expected'); //t.false(mapObject(args..), 'Expected');