Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work on these tests! They are well-structured and cover most of the requirements for the ifElse function.
I am requesting one change to fully meet the requirements. The test that verifies the condition callback is called is missing an important check. While you correctly assert that it's called, you also need to verify that it was called with no arguments as specified in the task description.
You can fix this by adding another assertion to that test in src/ifElse.test.js:
expect(condition).toHaveBeenCalledWith();Once that assertion is added, this will be ready for approval!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
src/ifElse.test.js
Outdated
| expect(second).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it('should call the secont function when condition is false', () => { |
There was a problem hiding this comment.
There's a small typo in the test description. It should be "second" instead of "secont".
|
|
||
| ifElse(condition, first, second); | ||
|
|
||
| expect(condition).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
This assertion correctly verifies that condition is called. However, the requirements also state that it should be called with no arguments. You should add another assertion here to verify that, for example: expect(condition).toHaveBeenCalledWith();.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this update! I'm happy to approve your solution. You've successfully addressed the feedback from the last review by adding the test to ensure the condition callback is called with no arguments. Your test suite is now comprehensive and covers all the requirements for the ifElse function. Great job bringing this to completion!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.