1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: maintenance

This commit is contained in:
Divlo
2021-12-04 15:52:51 +01:00
parent e5f4615f7f
commit 729e540d04
69 changed files with 10182 additions and 18460 deletions

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)
})
})