chore: maintenance

This commit is contained in:
Divlo
2022-02-20 15:12:10 +01:00
parent e5f4615f7f
commit 729e540d04
69 changed files with 10182 additions and 18460 deletions
+15
View File
@@ -0,0 +1,15 @@
import { getAge } from '../getAge'
describe('utils/getAge', () => {
it('should calculate the right age of a person', () => {
const birthDate = new Date('1980-02-20')
jest.useFakeTimers().setSystemTime(new Date('2018-03-20'))
expect(getAge(birthDate)).toBe(38)
})
it('should calculate the right age of a person (taking into account the months)', () => {
const birthDate = new Date('1980-07-20')
jest.useFakeTimers().setSystemTime(new Date('2018-03-20'))
expect(getAge(birthDate)).toBe(37)
})
})