11// Implement a function repeatStr
22const repeatStr = require ( "./repeat-str" ) ;
3- // Given a target string str and a positive integer count,
3+ // Given a target string ` str` and a positive integer ` count` ,
44// When the repeatStr function is called with these inputs,
55// Then it should:
66
7- // case: repeat String :
8- // Given a target string str and a positive integer count,
7+ // Case: handle multiple repetitions :
8+ // Given a target string ` str` and a positive integer ` count` greater than 1 ,
99// When the repeatStr function is called with these inputs,
10- // Then it should repeat the str count times and return a new string containing the repeated str values .
10+ // Then it should return a string that contains the original ` str` repeated `count` times .
1111
1212test ( "should repeat the string count times" , ( ) => {
1313 const str = "hello" ;
@@ -16,17 +16,17 @@ test("should repeat the string count times", () => {
1616 expect ( repeatedStr ) . toEqual ( "hellohellohello" ) ;
1717} ) ;
1818
19- // case : handle Count of 1:
20- // Given a target string str and a count equal to 1,
19+ // Case : handle count of 1:
20+ // Given a target string ` str` and a ` count` equal to 1,
2121// When the repeatStr function is called with these inputs,
22- // Then it should return the original str without repetition, ensuring that a count of 1 results in no repetition.
22+ // Then it should return the original ` str` without repetition.
2323
24- // case : Handle Count of 0:
25- // Given a target string str and a count equal to 0,
24+ // Case : Handle count of 0:
25+ // Given a target string ` str` and a ` count` equal to 0,
2626// When the repeatStr function is called with these inputs,
27- // Then it should return an empty string, ensuring that a count of 0 results in an empty output .
27+ // Then it should return an empty string.
2828
29- // case: Negative Count :
30- // Given a target string str and a negative integer count,
29+ // Case: Handle negative count :
30+ // Given a target string ` str` and a negative integer ` count` ,
3131// When the repeatStr function is called with these inputs,
3232// Then it should throw an error, as negative counts are not valid.
0 commit comments