-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,21 @@ describe('getHumanAge', () => { | |
expect(getHumanAge) | ||
.toBeInstanceOf(Function); | ||
}); | ||
|
||
test('animals` human age should be 0 if their own age < 15', () => { | ||
expect(getHumanAge(0, 14)).toEqual([0, 0]); | ||
}); | ||
|
||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
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 commentThe 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 |
||
}); |
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