Skip to content

Commit 556e363

Browse files
committed
added countChar test to check whether 0 is returned when string is empty
1 parent e8faea9 commit 556e363

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
@@ -28,3 +28,10 @@ test("should return 0 when character does not occur", () => {
2828
const count = countChar(str, char);
2929
expect(count).toEqual(0);
3030
});
31+
32+
test("should return 0 when string is empty", () => {
33+
const str = "";
34+
const char = "e";
35+
const count = countChar(str, char);
36+
expect(count).toEqual(0);
37+
});

0 commit comments

Comments
 (0)