Skip to content

Commit 408f2e1

Browse files
committed
Rewrite test with jest for repeat code
1 parent 52660c9 commit 408f2e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const repeat = require("./repeat");
1111

1212
test("should repeat the string count times", () => {
1313
const str = "hello";
14-
const count = 3;
14+
const count = 4;
1515
const repeatedStr = repeat(str, count);
16-
expect(repeatedStr).toEqual("hellohellohello");
16+
expect(repeatedStr).toEqual("hellohellohellohello");
1717
});
1818

1919
// case: handle Count of 1:
@@ -41,7 +41,7 @@ test("should return an empty string when count is 0", () => {
4141
// case: Negative Count:
4242
// Given a target string str and a negative integer count,
4343
// When the repeat function is called with these inputs,
44-
// Then it should throw an error or return an appropriate error message, as negative counts are not valid.
44+
// Then it should throw an error or return an appropriate error message,as negative counts are not valid.
4545
test("should throw an error when count is negative", () => {
4646
const str = "hello";
4747
const count = -2;

0 commit comments

Comments
 (0)