London | 26-ITP-May | Oussama Mouggal | Sprint 3 | coursework-practice-tdd#1029
London | 26-ITP-May | Oussama Mouggal | Sprint 3 | coursework-practice-tdd#1029Oussama-Mouggal wants to merge 6 commits intoCodeYourFuture:mainfrom
Conversation
…est for zero occurrences
There was a problem hiding this comment.
I believe there is still room for improvement for this file. You didn't test for the number ending with 11. Also, for the other test cases, there should be a test to verify that the except values will not have the appended string example. using 12 should return 12nd. If you still want to experiment, you can change your except valuese from those ending with 12, 13 to 22 and 33.
There was a problem hiding this comment.
Thank you @Edu-Vin for your valuable feedback and remarks. I added more cases to my test/code to test all posibilities.
| test("should throw an error when count is negative", () => { | ||
| const str = "hello"; | ||
| const count = -1; | ||
| expect(() => repeatStr(str, count)).toThrow(); |
There was a problem hiding this comment.
To take this further, why not also check if the expected message is returned?
There was a problem hiding this comment.
Thank you for your message. I added a comment which will return in case of an error message.
Self checklist
Changelist
tested edge cases and rewirted functions to pass the npm test