mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
✨ add an algorithm for checking a year is a leap year or not
This commit is contained in:
22
Maths/test/LeapYear.test.js
Normal file
22
Maths/test/LeapYear.test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { isLeapYear } from '../LeapYear'
|
||||
|
||||
describe('Leap Year', () => {
|
||||
it('Should return true on the year 2000', () => {
|
||||
expect(isLeapYear(2000)).toBe(true)
|
||||
})
|
||||
it('Should return false on the year 2001', () => {
|
||||
expect(isLeapYear(2001)).toBe(false)
|
||||
})
|
||||
it('Should return false on the year 2002', () => {
|
||||
expect(isLeapYear(2002)).toBe(false)
|
||||
})
|
||||
it('Should return false on the year 2003', () => {
|
||||
expect(isLeapYear(2003)).toBe(false)
|
||||
})
|
||||
it('Should return false on the year 2004', () => {
|
||||
expect(isLeapYear(2004)).toBe(true)
|
||||
})
|
||||
it('Should return false on the year 1900', () => {
|
||||
expect(isLeapYear(1900)).toBe(false)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user