Skip to content

Commit ea11468

Browse files
committed
Fix test for negative count
1 parent 6ad7b43 commit ea11468

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎practice-tdd/repeat-str.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,5 @@ test("should return empty string, count = 0", () => {
4646
test("should return error, count < 0", () => {
4747
const str = "hello";
4848
const count = -5;
49-
const repeatedStr = repeatStr(str, count);
50-
expect(repeatedStr).toThrow('Error');
49+
expect(() => repeatStr(str, count)).toThrow(/Error/);
5150
});

0 commit comments

Comments
 (0)