From c44d5747928850208fdee15373a71a380b668924 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Sat, 16 Nov 2024 17:12:52 +0200 Subject: [PATCH] Solution --- src/getHumanAge.test.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/getHumanAge.test.js b/src/getHumanAge.test.js index 6ce3e586..4ea968bb 100644 --- a/src/getHumanAge.test.js +++ b/src/getHumanAge.test.js @@ -7,4 +7,44 @@ describe('getHumanAge', () => { expect(getHumanAge) .toBeInstanceOf(Function); }); + + test('should return [0, 0] for age 0', () => { + expect(getHumanAge(0, 0)) + .toEqual([0, 0]); + }); + + test('should return [0, 0] for age 14', () => { + expect(getHumanAge(14, 14)) + .toEqual([0, 0]); + }); + + test('should return [1, 1] for age 15', () => { + expect(getHumanAge(15, 15)) + .toEqual([1, 1]); + }); + + test('should return [1, 1] for age 23', () => { + expect(getHumanAge(23, 23)) + .toEqual([1, 1]); + }); + + test('should return [2, 2] for age 24', () => { + expect(getHumanAge(24, 24)) + .toEqual([2, 2]); + }); + + test('should return [2, 2] for age 27', () => { + expect(getHumanAge(27, 27)) + .toEqual([2, 2]); + }); + + test('should return [3, 2] for age 28', () => { + expect(getHumanAge(28, 28)) + .toEqual([3, 2]); + }); + + test('should return [21, 17] for age 100', () => { + expect(getHumanAge(100, 100)) + .toEqual([21, 17]); + }); });