Skip to content

Commit 7816f8b

Browse files
committed
Test for no occurences of a character
1 parent a4f590b commit 7816f8b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ test("should count multiple occurrences of a character", () => {
1010
});
1111

1212
// Scenario 2: Single Occurrence
13-
test("should count multiple occurrences of a character", () => {
13+
test("should count single occurrence of a character", () => {
1414
expect(countChar("a", "a")).toEqual(1);
1515
expect(countChar("Star Light", "i")).toEqual(1);
1616
expect(countChar("!@#$%^&*()", "#")).toEqual(1);
1717
expect(countChar("onomatopoeia", "t")).toEqual(1);
1818
});
1919

20-
// Scenario: No Occurrences
21-
// Given the input string `str`,
22-
// And a character `char` that does not exist within `str`.
23-
// When the function is called with these inputs,
24-
// Then it should return 0, indicating that no occurrences of `char` were found.
20+
// Scenario 3: No Occurrence
21+
test("should count single occurrence of a character", () => {
22+
expect(countChar("The Rookie", "S")).toEqual(0);
23+
expect(countChar("Angela Bassett", "r")).toEqual(0);
24+
expect(countChar("Angela Bassett", "r")).toEqual(0);
25+
expect(countChar("Better Off Ted", "9")).toEqual(0);
26+
});

0 commit comments

Comments
 (0)