Skip to content

Commit 9e74422

Browse files
authored
fixing the code to run the jest test
1 parent 0f0c704 commit 9e74422

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
function repeat(str, count) {
2+
if (str === undefined || count === undefined){
3+
throw new Error ("argument must be defined")
4+
}
25
if (count < 0) {
36
throw new Error("Count must be a non-negative integer");
47
}
@@ -13,5 +16,5 @@ function repeat(str, count) {
1316

1417
module.exports = repeat;
1518

16-
console.log(repeat("hello", 3));
19+
1720

0 commit comments

Comments
 (0)