From e83b38399125388e4bf8df62b84db42a0c88c847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Sun, 4 Feb 2018 21:37:37 +0100 Subject: [PATCH] add test for equal --- test/binarySearch/binarySearch.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/binarySearch/binarySearch.test.js b/test/binarySearch/binarySearch.test.js index cd7d7c2ed..e408ca3d1 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -8,6 +8,7 @@ test('Testing binarySearch', (t) => { //t.deepEqual(binarySearch(args..), 'Expected'); t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6), 2, 'Finds item in array'); t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21), -1, 'Returns -1 when not found'); + t.equal(binarySearch([], 21), -1, 'Works with empty arrays'); //t.false(binarySearch(args..), 'Expected'); //t.throws(binarySearch(args..), 'Expected'); t.end();