Skip to content

task#230

Open
shelyaa wants to merge 2 commits intomate-academy:masterfrom
shelyaa:dev
Open

task#230
shelyaa wants to merge 2 commits intomate-academy:masterfrom
shelyaa:dev

Conversation

@shelyaa
Copy link

@shelyaa shelyaa commented Dec 10, 2025

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

expect(second).not.toHaveBeenCalled();
});

it('should call the secont function when condition is false', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small typo in the test description. It should be "second" instead of "secont".


ifElse(condition, first, second);

expect(condition).toHaveBeenCalledTimes(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants