Skip to content

Commit 780bc1c

Browse files
committed
Add a test for an empty input
1 parent 714b6fa commit 780bc1c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎practice-tdd/count.test.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ test("should count zero occurrences of a character", () => {
2929
const count = countChar(str, char);
3030
expect(count).toEqual(0);
3131
});
32+
33+
test("should return 0 for no input", () => {
34+
const str = "";
35+
const char = "b";
36+
const count = countChar(str, char);
37+
expect(count).toEqual(0);
38+
});

0 commit comments

Comments
 (0)