Skip to content

Commit bd8ab4b

Browse files
committed
I Added working countChar function
1 parent 8f3d6cf commit bd8ab4b

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
@@ -3,6 +3,14 @@ const countChar = require("./count");
33
// Given a string str and a single character char to search for,
44
// When the countChar function is called with these inputs,
55
// Then it should:
6+
test("count how many times a character occurs a string", () => {
7+
const stringOfCharacters = "kiwi";
8+
const findCharacter = "w";
9+
10+
const result = countChar(stringOfCharacters, findCharacter);
11+
12+
expect(result).toBe(5);
13+
});
614

715
// Scenario: Multiple Occurrences
816
// Given the input string str,

0 commit comments

Comments
 (0)