Cape Town | 26-ITP-May | Liyema Mfengwana | Sprint 3 | PracticeTDD - #1512
Cape Town | 26-ITP-May | Liyema Mfengwana | Sprint 3 | PracticeTDD#1512LiyemaMfengwana wants to merge 15 commits into
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Have you been running these tests on your machine? I get an error when I try to run them. Can you try to figure out what is happening?
| const str = "hello"; | ||
| const count = -1; | ||
|
|
||
| expect(() => repeatStr(str, count)).toThrow(); |
There was a problem hiding this comment.
Yeah, these tests should pass. They are checking the basic cases like repeating the string multiple times, returning the same string when the count is 1, an empty string when the count is 0, and throwing an error if the count is negative. If they are not passing, I think the problem is probably with the function code or the test setup, not the tests themselves.
|
Have you run the tests on your machine? When I run them, I get an error. Can you try to figure out why this might be happening? |
LonMcGregor
left a comment
There was a problem hiding this comment.
I am still getting an error with running jest. Have a look and make sure the functions are defined properly. Have you got any duplicate function names?
|
PASS Sprint-3/2-practice-tdd/repeat-str.test.js |
LonMcGregor
left a comment
There was a problem hiding this comment.
You spotted that you needed to remove the duplicate functions - good!
Self checklist
Changelist
complete practicetdd