Skip to content

Commit 0f0c704

Browse files
authored
editing the code
1 parent c491953 commit 0f0c704

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test("should repeat the string count times", () => {
1616
expect(repeatedStr).toEqual("hellohellohellohello");
1717
});
1818

19-
/const repeat = require("./repeat");
19+
const repeat = require("./repeat");
2020

2121
// case: Handle Count of 1 :
2222
// Given a target string str and a count equal to 1,
@@ -77,9 +77,8 @@ test("should return an empty string when str is empty", () => {
7777
// case: Undefined or missing arguments :
7878
// When arguments are missing or undefined, it should throw an error.
7979
test("should handle undefined inputs gracefully", () => {
80-
expect(() => repeat(undefined, 3)).toThrow();
81-
expect(() => repeat("hello")).toThrow();
82-
expect(() => repeat()).toThrow();
80+
expect(() => repeat(undefined, 3)).toThrow("argument must be defined");
81+
8382
});
8483

8584
// case: Boolean inputs :

0 commit comments

Comments
 (0)