Skip to content

Commit 7455253

Browse files
test: add test case for returning original string when count is 1
1 parent 6a021e3 commit 7455253

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ test("should repeat the string count times", () => {
2020
// Given a target string str and a count equal to 1,
2121
// When the repeatStr function is called with these inputs,
2222
// Then it should return the original str without repetition, ensuring that a count of 1 results in no repetition.
23+
test("should return the original string when count is 1", () => {
24+
const str = "hello";
25+
const count = 1;
26+
const repeatedStr = repeat(str, count);
27+
expect(repeatedStr).toEqual("hello");
28+
});
2329

2430
// case: Handle Count of 0:
2531
// Given a target string str and a count equal to 0,

0 commit comments

Comments
 (0)