We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93d9cb6 commit 9bc1c34Copy full SHA for 9bc1c34
Sprint-3/2-practice-tdd/count.test.js
@@ -27,4 +27,17 @@ test("should return 0 occurence of a character", () => {
27
const char = "z";
28
const count = countChar(str, char);
29
expect(count).toEqual(0);
30
-})
+});
31
+
32
+// Scenario: One occurrence
33
+// Given an input string `str`,
34
+// And a character `char` that occurs once within `str` (e.g., 'a' in 'boat'),
35
+// When the function is called with these inputs,
36
+// Then it should correctly return the count of `char` (e.g., 'a' appears once in 'boat').
37
38
+test("should return 1 occurence of a character", () => {
39
+ const str = "boat";
40
+ const char = "a";
41
+ const count = countChar(str, char);
42
+ expect(count).toEqual(1);
43
0 commit comments