From 8506111ecebe015b1bd5e7fd329b73625f7ddc7d Mon Sep 17 00:00:00 2001 From: Joe Helfrich Date: Sat, 17 Sep 2016 19:45:58 -0400 Subject: [PATCH] Add test for single occurance The tests as written do not cover the scenario where the code under test returns true if the value appears one or more times (rather than two or more times.) Adds a new test where the first array contains one value that appears only once in the second array, that is expected to be false. --- 06-arrays/tests.js | 1 + 1 file changed, 1 insertion(+) diff --git a/06-arrays/tests.js b/06-arrays/tests.js index da96a31..347eb8a 100644 --- a/06-arrays/tests.js +++ b/06-arrays/tests.js @@ -49,6 +49,7 @@ describe("#containsAnyTwice", function () { expect(containsAnyTwice([1, 2], ["hello", 1, "world", 1])).toBe(true); expect(containsAnyTwice([], ["always", "will", "return", "false"])).toBe(false); expect(containsAnyTwice(["hello", "world"], ["hello", "hello", "world", "world"])).toBe(true); + expect(containsAnyTwice(["hello"], ['hello', 'world', 'world'])).toBe(false); }); it ("should throw an error if either of the arguments are not arrays", function () {