Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #590

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Pavlo-Petrashevskyi
Copy link

tests for getHumanAge function were added

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.

Great job on implementing the getHumanAge function! 🎉 The code meets the task requirements, and the tests are well-structured. Just make sure the logic for calculating human years after 23 is correctly understood and implemented. Keep up the good work! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines 11 to 13
test('animals` human age should be 0 if their own age < 15', () => {
expect(getHumanAge(0, 14)).toEqual([0, 0]);
});

Choose a reason for hiding this comment

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

The test description and expectation seem correct for ages less than 15, assuming the function is supposed to return 0 for both animals. Ensure that the getHumanAge function aligns with this logic.

Copy link
Author

Choose a reason for hiding this comment

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

done

Comment on lines 15 to 17
test('animals` human age should be 1 if their own age > 14 and < 24', () => {
expect(getHumanAge(15, 23)).toEqual([1, 1]);
});

Choose a reason for hiding this comment

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

The test description and expectation are consistent for ages between 15 and 23. Verify that the getHumanAge function implements this logic correctly.

Copy link
Author

Choose a reason for hiding this comment

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

done

Comment on lines 19 to 26
test(`cat's age should add 1 every 4 years after 23 years old
dog's age should add 1 every 5 years after 23 years old`, () => {
expect(getHumanAge(24, 24)).toEqual([2, 2]);
expect(getHumanAge(27, 28)).toEqual([2, 2]);
expect(getHumanAge(31, 33)).toEqual([3, 3]);
expect(getHumanAge(59, 59)).toEqual([10, 9]);
expect(getHumanAge(47, 88)).toEqual([7, 14]);
});

Choose a reason for hiding this comment

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

The logic described in the test case for ages after 23 might be incorrect or misunderstood. Ensure that the getHumanAge function correctly implements the logic where a cat's age adds 1 every 4 years and a dog's age adds 1 every 5 years after 23 years old. The expectations in the test cases should reflect this logic accurately.

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