Add Get Numbers of Days of a Month (#464)

This commit is contained in:
Mahfoudh Arous
2020-10-12 17:04:55 +01:00
committed by GitHub
parent 50aeb7eb68
commit 86f3f5680f
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import { getMonthDays } from './GetMonthDays'
describe('Get the Days of a Month', () => {
it('expects to return 28', () => {
expect(getMonthDays(2, 2018)).toEqual(28)
})
it('expects to return 30', () => {
expect(getMonthDays(6, 254)).toEqual(30)
})
it('expects to return 29', () => {
expect(getMonthDays(2, 2024)).toEqual(29)
})
it('expects to throw a type error', () => {
expect(() => { getMonthDays(13, 2020) }).toThrow('Invalid Month Number.')
})
})