Skip to content

Commit 641752b

Browse files
committed
added more tests for repeat-str
1 parent c8ec84e commit 641752b

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎practice-tdd/repeat-str.test.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ test("should repeat the string count 0 times", () => {
3737
expect(repeatedStr).toEqual("");
3838
});
3939

40+
test("should repeat the empty string count 0 times", () => {
41+
const str = "";
42+
const count = 3;
43+
const repeatedStr = repeatStr(str, count);
44+
expect(repeatedStr).toEqual("");
45+
});
46+
47+
test("should repeat the space in string count 3 times", () => {
48+
const str = " ";
49+
const count = 3;
50+
const repeatedStr = repeatStr(str, count);
51+
expect(repeatedStr).toEqual(" ");
52+
});
53+
54+
test("should repeat the symbols in string count 3 times", () => {
55+
const str = "@%£$";
56+
const count = 3;
57+
const repeatedStr = repeatStr(str, count);
58+
expect(repeatedStr).toEqual("@%£$@%£$@%£$");
59+
});
60+
4061
// Case: Handle negative count:
4162
// Given a target string `str` and a negative integer `count`,
4263
// When the repeatStr function is called with these inputs,

0 commit comments

Comments
 (0)