Skip to content

Commit 129958c

Browse files
wrote test to check if the character exists within the string
1 parent bd742bc commit 129958c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const countChar = require("./count");
44
// When the countChar function is called with these inputs,
55
// Then it should:
66

7-
// Scenario: Multiple Occurrences
7+
// Scenario: Multiple Occurrences
88
// Given the input string str,
99
// And a character char that may occur multiple times with overlaps within str (e.g., 'a' in 'aaaaa'),
1010
// When the function is called with these inputs,
@@ -22,3 +22,9 @@ test("should count multiple occurrences of a character", () => {
2222
// And a character char that does not exist within the case-sensitive str,
2323
// When the function is called with these inputs,
2424
// Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str.
25+
test("should return 0 if the character does not occur",()=>{
26+
const str1="ads1"
27+
const char1="l"
28+
const count1=countChar(str1,char1)
29+
expect(count1).toEqual(0)
30+
})

0 commit comments

Comments
 (0)