Skip to content

Commit 587bb75

Browse files
committed
fix errors
1 parent 3c97cd2 commit 587bb75

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,26 @@ test("should count multiple occurrences of a character", () => {
1818
});
1919

2020
// Scenario: No Occurrences
21+
test("should return 0 when the character does not occur in the string", () => {
22+
// Given the input string `str`
23+
const str = "hello";
24+
const char = "z";
25+
const count = countChar(str, char);
26+
expect(count).toEqual(0);
27+
});
28+
29+
// // And a character `char` that does not exist in the string
30+
// const char = "z";
31+
32+
// // When the function is called with these inputs
33+
// const count = countChar(str, char);
34+
35+
// // Then it should return 0
36+
// expect(count).toEqual(0);
37+
// });
38+
2139
// Given the input string `str`,
40+
2241
// And a character `char` that does not exist within `str`.
2342
// When the function is called with these inputs,
2443
// Then it should return 0, indicating that no occurrences of `char` were found.

0 commit comments

Comments
 (0)