From 338c661e64a2b237744c17cfbb9fcdfee599c1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 16:45:55 +0100 Subject: [PATCH] add 2 tests, gcd & geometricProgression --- test/gcd/gcd.test.js | 3 ++- test/geometricProgression/geometricProgression.test.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js index e1904173d..4df17ce90 100644 --- a/test/gcd/gcd.test.js +++ b/test/gcd/gcd.test.js @@ -5,7 +5,8 @@ test('Testing gcd', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof gcd === 'function', 'gcd is a Function'); - //t.deepEqual(gcd(args..), 'Expected'); + t.equal(gcd(8, 36), 4, "Calculates the greatest common divisor between two or more numbers/arrays"); + t.equal(gcd(...[12, 8, 32]), 4, "Calculates the greatest common divisor between two or more numbers/arrays"); //t.deepEqual(gcd(args..), 'Expected'); //t.equal(gcd(args..), 'Expected'); //t.false(gcd(args..), 'Expected'); //t.throws(gcd(args..), 'Expected'); diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js index d0f8d1e8e..09fb3093d 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -5,6 +5,9 @@ test('Testing geometricProgression', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof geometricProgression === 'function', 'geometricProgression is a Function'); + t.deepEqual(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128, 256], "Initializes an array containing the numbers in the specified range"); + t.deepEqual(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96, 192], "Initializes an array containing the numbers in the specified range"); + t.deepEqual(geometricProgression(256, 1, 4), [1, 4, 16, 64, 256], "Initializes an array containing the numbers in the specified range"); //t.deepEqual(geometricProgression(args..), 'Expected'); //t.equal(geometricProgression(args..), 'Expected'); //t.false(geometricProgression(args..), 'Expected');