Skip to content

Commit 6b14ae9

Browse files
committed
More adjustments made
1 parent 7c05e43 commit 6b14ae9

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ test("should count multiple occurrences of a character", () => {
2222
// And a character `char` that does not exist within `str`.
2323
// When the function is called with these inputs,
2424
// Then it should return 0, indicating that no occurrences of `char` were found.
25-
test("should return 0 when the character does not occur in the string", () => {
26-
const str = "hello world";
27-
const char = "x";
25+
26+
const countChar = require("./count");
27+
28+
test("should count multiple occurrences of a character", () => {
29+
const str = "aaaaa";
30+
const char = "a";
2831
const count = countChar(str, char);
29-
expect(count).toEqual(0);
30-
} );
32+
expect(count).toEqual(5);
33+
});
3134

35+
test("should return 0 if the character does not exist", () => {
36+
const str = "hello";
37+
const char = "z";
38+
const count = countChar(str, char);
39+
expect(count).toEqual(0);
40+
});

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"keywords": [],
1010
"author": "Code Your Future",
1111
"license": "ISC",
12-
"dependencies": {
13-
"jest": "^29.7.0"
12+
"devDependencies": {
13+
"jest": "^30.2.0"
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)