Skip to content

Commit 0ac1333

Browse files
authored
Add test for null and undefined string inputs
1 parent 6ee1609 commit 0ac1333

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Sprint-3/2-practice-tdd/count.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,10 @@ test("handles null or undefined source string", () => {
4747
expect(countChar(null, char)).toEqual(0);
4848
expect(countChar(undefined, char)).toEqual(0);
4949
});
50+
51+
test("returns 0 when stringOfCharacters is null or undefined", () => {
52+
const char = "a";
53+
54+
expect(countChar(null, char)).toEqual(0);
55+
expect(countChar(undefined, char)).toEqual(0);
56+
});

0 commit comments

Comments
 (0)