From 9713dbe049351ff05734740f8f6559580042b0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 15:04:00 +0100 Subject: [PATCH] add 2 tests for join and last --- test/join/join.test.js | 4 ++++ test/last/last.test.js | 1 + test/lcm/lcm.test.js | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/join/join.test.js b/test/join/join.test.js index fb3529360..e0238a7b7 100644 --- a/test/join/join.test.js +++ b/test/join/join.test.js @@ -5,6 +5,10 @@ test('Testing join', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof join === 'function', 'join is a Function'); + t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'), "pen,pineapple,apple&pen", "Joins all elements of an array into a string and returns this string"); + t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ','), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string"); + t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen']), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string"); + //t.deepEqual(join(args..), 'Expected'); //t.equal(join(args..), 'Expected'); //t.false(join(args..), 'Expected'); diff --git a/test/last/last.test.js b/test/last/last.test.js index d077c6806..d17d65c90 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -5,6 +5,7 @@ test('Testing last', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof last === 'function', 'last is a Function'); + t.equal(last([1, 2, 3]), 3, "Returns the last element in an array"); //t.deepEqual(last(args..), 'Expected'); //t.equal(last(args..), 'Expected'); //t.false(last(args..), 'Expected'); diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js index ce1e5b679..469dce174 100644 --- a/test/lcm/lcm.test.js +++ b/test/lcm/lcm.test.js @@ -7,7 +7,6 @@ test('Testing lcm', (t) => { t.true(typeof lcm === 'function', 'lcm is a Function'); t.equal(lcm(12, 7), 84, "Returns the least common multiple of two or more numbers."); t.equal(lcm(...[1, 3, 4, 5]), 60, "Returns the least common multiple of two or more numbers."); - //t.deepEqual(lcm(args..), 'Expected'); //t.equal(lcm(args..), 'Expected'); //t.false(lcm(args..), 'Expected');