-
Notifications
You must be signed in to change notification settings - Fork 619
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
base: main
Are you sure you want to change the base?
Solution #590
Conversation
There was a problem hiding this 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! ✨
src/getHumanAge.test.js
Outdated
test('animals` human age should be 0 if their own age < 15', () => { | ||
expect(getHumanAge(0, 14)).toEqual([0, 0]); | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/getHumanAge.test.js
Outdated
test('animals` human age should be 1 if their own age > 14 and < 24', () => { | ||
expect(getHumanAge(15, 23)).toEqual([1, 1]); | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/getHumanAge.test.js
Outdated
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]); | ||
}); |
There was a problem hiding this comment.
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.
tests for getHumanAge function were added