From 6ded0be9ff48691fdd7eeafed6b9cb0f1f342549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 14:30:17 +0100 Subject: [PATCH] add 2 tests, nthElement & objectFromPairs --- test/nthElement/nthElement.test.js | 2 ++ test/objectFromPairs/objectFromPairs.test.js | 1 + 2 files changed, 3 insertions(+) diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js index 4c615ee7b..4628abcda 100644 --- a/test/nthElement/nthElement.test.js +++ b/test/nthElement/nthElement.test.js @@ -5,6 +5,8 @@ test('Testing nthElement', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof nthElement === 'function', 'nthElement is a Function'); + t.equal(nthElement(['a', 'b', 'c'], 1), 'b', "Returns the nth element of an array."); + t.equal(nthElement(['a', 'b', 'c'], -3), 'a', "Returns the nth element of an array."); //t.deepEqual(nthElement(args..), 'Expected'); //t.equal(nthElement(args..), 'Expected'); //t.false(nthElement(args..), 'Expected'); diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js index a978cd279..a661ac37f 100644 --- a/test/objectFromPairs/objectFromPairs.test.js +++ b/test/objectFromPairs/objectFromPairs.test.js @@ -5,6 +5,7 @@ test('Testing objectFromPairs', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof objectFromPairs === 'function', 'objectFromPairs is a Function'); + t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs."); //t.deepEqual(objectFromPairs(args..), 'Expected'); //t.equal(objectFromPairs(args..), 'Expected'); //t.false(objectFromPairs(args..), 'Expected');