Skip to content

Commit 2438af2

Browse files
wrote a test case to check for empty string
1 parent 0c2366b commit 2438af2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ test("should count non-alphabet characters", () => {
4242
expect(countChar("1231", "1")).toEqual(2);
4343
expect(countChar("!?!?", "!")).toEqual(2);
4444
});
45+
46+
// New: empty string
47+
test("should return 0 for empty string input", () => {
48+
expect(countChar("", "a")).toEqual(0);
49+
});

0 commit comments

Comments
 (0)