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 #621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/getHumanAge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,28 @@ describe('getHumanAge', () => {
expect(getHumanAge)
.toBeInstanceOf(Function);
});

test('should return [0, 0] if CatAge = 0 and DogAge = 0', () => {
expect(getHumanAge(0, 0)).toEqual([0, 0]);
});

test('should return [0, 0] if CatAge and DogAge < 14', () => {
expect(getHumanAge(14, 14)).toEqual([0, 0]);
});
Comment on lines +15 to +17

Choose a reason for hiding this comment

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

The test case description states that it should return [0, 0] if CatAge and DogAge are less than 14. However, the input values are exactly 14. Consider changing the input values to something less than 14, such as getHumanAge(13, 13), to match the test description and the task requirements.


test('should return [1, 1] if CatAge and DogAge === 15', () => {
expect(getHumanAge(15, 15)).toEqual([1, 1]);
});

test('should return [2, 2] for catAge = 24 and dogAge = 24', () => {
expect(getHumanAge(24, 24)).toEqual([2, 2]);
});

test('should return [4, 3] for catAge = 32 and dogAge = 32', () => {
expect(getHumanAge(32, 32)).toEqual([4, 3]);
});

test('should return [21, 17] for catAge = 100 and dogAge = 100', () => {
expect(getHumanAge(100, 100)).toEqual([21, 17]);
});
});