From f07a146ce7f079e21d5ad91411dfe99c9b1ad25e Mon Sep 17 00:00:00 2001 From: Kashyap Date: Sat, 5 Oct 2019 12:27:30 +0530 Subject: [PATCH] TernarySearch tests added, 100% coverage --- test/algorithms/search/testTernarySearch.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/algorithms/search/testTernarySearch.js b/test/algorithms/search/testTernarySearch.js index 6f598d04..b5eb5b17 100644 --- a/test/algorithms/search/testTernarySearch.js +++ b/test/algorithms/search/testTernarySearch.js @@ -32,4 +32,9 @@ describe('Ternary Search', () => { assert.equal(index, 4); }); + + it('should return index of element between two mid points', () => { + const index = ternarysearch([2, 3, 4, 5, 6, 8, 10], 5); + assert.equal(index, 3); + }); });