London | 26-ITP-Jan | Maryanne Mosonik | Sprint 3 | Practice-TDD#1069
London | 26-ITP-Jan | Maryanne Mosonik | Sprint 3 | Practice-TDD#1069Maryanne-K wants to merge 10 commits intoCodeYourFuture:mainfrom
Conversation
…es based on input number
| test("should throw an error when count is negative", () => { | ||
| const str = "hello"; | ||
| const count = -1; | ||
| expect(() => repeatStr(str, count)).toThrow("Count must be a non-negative integer"); | ||
| }); |
There was a problem hiding this comment.
Can your implementation pass this test?
There was a problem hiding this comment.
Yes it would because it is specifically checking for a negative count, which is an error.
@cjyuan Kindly check implemented corrections. Thank you for your help.
There was a problem hiding this comment.
Did you run the test script to find out if your function can pass the test or if the test is prepared correctly?
There was a problem hiding this comment.
Apologies, just checked, it fails, forgot to add the word integer as the expected substring and received messages were different.
|
You should also add the "Needs Review" label when the PR is ready to be re-reviewed. |
This comment has been minimized.
This comment has been minimized.
|
Changes to the code look good. But your last commit also committed a change to Can you revert (undo) the change to One way to revert changes to a file is via the First, locate a commit before the file was modified. It could be the first commit you made, assuming the branch started in a clean state. Next, record the first 7 characters of the commit SHA. Suppose the file is After the file is restored, make a commit and push the changes to GitHub. |
ea18c85 to
6a8425e
Compare
Just saw this, thank you CJ. I deleted my last commit, force pushed and made the changes again. |
|
All good now! Well done. |
This PR contains the Practise-TDD section of Sprint 3.
I agree to follow the code of conduct for this organisation.