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

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
40 changes: 40 additions & 0 deletions src/getHumanAge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,44 @@ describe('getHumanAge', () => {
expect(getHumanAge)
.toBeInstanceOf(Function);
});

test('should return [0, 0] when cat and dog ages are 0', () => {
expect(getHumanAge(0, 0))
.toEqual([0, 0]);
});

test('should return [0, 0] when cat and dog ages are 14', () => {
expect(getHumanAge(14, 14))
.toEqual([0, 0]);
});

test('should return [1, 1] when cat and dog ages are 15', () => {
expect(getHumanAge(15, 15))
.toEqual([1, 1]);
});

test('should return [1, 1] when cat and dog ages are 23', () => {
expect(getHumanAge(23, 23))
.toEqual([1, 1]);
});

test('should return [2, 2] when cat and dog ages are 24', () => {
expect(getHumanAge(24, 24))
.toEqual([2, 2]);
});

test('should return [2, 2] when cat and dog ages are 27', () => {
expect(getHumanAge(27, 27))
.toEqual([2, 2]);
});

test('should return [3, 2] when cat and dog ages are 28', () => {
expect(getHumanAge(28, 28))
.toEqual([3, 2]);
});

test('should return [21, 17] when cat and dog ages are 100', () => {
expect(getHumanAge(100, 100))
.toEqual([21, 17]);
});
});