2024-01-05 19:11:55 +00:00
|
|
|
const leapYears = require('./leapYears')
|
|
|
|
|
|
|
|
describe('leapYears', () => {
|
|
|
|
test('works with non century years', () => {
|
|
|
|
expect(leapYears(1996)).toBe(true);
|
|
|
|
});
|
2024-01-05 21:00:05 +00:00
|
|
|
test('works with non century years', () => {
|
2024-01-05 19:11:55 +00:00
|
|
|
expect(leapYears(1997)).toBe(false);
|
|
|
|
});
|
2024-01-05 21:00:05 +00:00
|
|
|
test('works with ridiculously futuristic non century years', () => {
|
2024-01-05 19:11:55 +00:00
|
|
|
expect(leapYears(34992)).toBe(true);
|
|
|
|
});
|
2024-01-05 21:00:05 +00:00
|
|
|
test('works with century years', () => {
|
2024-01-05 19:11:55 +00:00
|
|
|
expect(leapYears(1900)).toBe(false);
|
|
|
|
});
|
2024-01-05 21:00:05 +00:00
|
|
|
test('works with century years', () => {
|
2024-01-05 19:11:55 +00:00
|
|
|
expect(leapYears(1600)).toBe(true);
|
|
|
|
});
|
2024-01-05 21:00:05 +00:00
|
|
|
test('works with century years', () => {
|
2024-01-05 19:11:55 +00:00
|
|
|
expect(leapYears(700)).toBe(false);
|
|
|
|
});
|
|
|
|
});
|