Skip to content

Commit 0daeef7

Browse files
I added the error message to improve the code and the test
1 parent a2c2560 commit 0daeef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test("should return an empty string when count is 0", () => {
3535
test("should throw an error when count is negative", () => {
3636
const str = "hello";
3737
const count = -1;
38-
expect(() => repeatStr(str, count)).toThrow();
38+
expect(() => repeatStr(str, count)).toThrow("Count must be non-negative");
3939
});
4040
// Case: handle count of 1:
4141
// Given a target string `str` and a `count` equal to 1,

0 commit comments

Comments
 (0)