Skip to content

Commit 37b2b72

Browse files
author
Pretty Taruvinga
committed
Add test case for non-alphabet characters in countChar
1 parent cf348b5 commit 37b2b72

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ test("should be case sensitive", () => {
3939
const count = countChar(str, char);
4040
expect(count).toEqual(1);
4141
});
42+
43+
test("should count non-alphabet characters", () => {
44+
const str = "hello!!!";
45+
const char = "!";
46+
const count = countChar(str, char);
47+
expect(count).toEqual(3);
48+
});

0 commit comments

Comments
 (0)