Skip to content

Commit db30440

Browse files
committed
Fix tests for repeat-str.js
1 parent 1a1df6f commit db30440

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test("should repeat the string count times", () => {
2424
test("Should return the original string with no repetitions", () => {
2525
const str = "hello";
2626
const count = 1;
27-
const repeatedStr = repeatedStr(str, count);
27+
const repeatedStr = repeatStr(str, count);
2828
expect(repeatedStr).toEqual("hello");
2929
});
3030

@@ -35,7 +35,7 @@ test("Should return the original string with no repetitions", () => {
3535
test("Should return an empty string", () => {
3636
const str = "hello";
3737
const count = 0;
38-
const repeatedStr = repeatedStr(str, count);
38+
const repeatedStr = repeatStr(str, count);
3939
expect(repeatedStr).toEqual("");
4040
});
4141

@@ -47,6 +47,5 @@ test("Should return an empty string", () => {
4747
test("Should throw an error, as negative counts are not valid", () => {
4848
const str = "hello";
4949
const count = -1;
50-
const repeatedStr = repeatedStr(str, count);
51-
expect(repeatedStr).toThrow(Error);
50+
expect(() => repeatStr(str, count)).toThrow("Expected a positive integer");
5251
});

0 commit comments

Comments
 (0)