Skip to content

Commit a4f590b

Browse files
committed
Test for single occurence of a character
1 parent e918829 commit a4f590b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ test("should count multiple occurrences of a character", () => {
99
expect(countChar("* Star * TV *", "*")).toEqual(3);
1010
});
1111

12+
// Scenario 2: Single Occurrence
13+
test("should count multiple occurrences of a character", () => {
14+
expect(countChar("a", "a")).toEqual(1);
15+
expect(countChar("Star Light", "i")).toEqual(1);
16+
expect(countChar("!@#$%^&*()", "#")).toEqual(1);
17+
expect(countChar("onomatopoeia", "t")).toEqual(1);
18+
});
19+
1220
// Scenario: No Occurrences
1321
// Given the input string `str`,
1422
// And a character `char` that does not exist within `str`.

0 commit comments

Comments
 (0)