We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbc996c commit 5ee3f6bCopy full SHA for 5ee3f6b
Sprint-3/2-practice-tdd/repeat.test.js
@@ -36,9 +36,9 @@ test("should return an empty string when count is 0", () => {
36
// Given a target string str and a negative integer count,
37
// When the repeat function is called with these inputs,
38
// Then it should throw an error or return an appropriate error message, as negative counts are not valid.
39
-test("should return a message for negative count", () => {
+test("should throw an error for negative count", () => {
40
const str = "error";
41
const count = -2;
42
- const repeatedStr = repeat(str, count);
43
- expect(repeatedStr).toEqual("Count must be a non-negative integer");
+
+ expect(() => repeat(str, count)).toThrow("Count must be a non-negative integer");
44
});
0 commit comments