2023-02-01 23:53:54 +00:00
|
|
|
const leapYears = require('./leapYears-solution');
|
2022-02-20 19:07:44 +00:00
|
|
|
|
2023-02-01 23:53:54 +00:00
|
|
|
describe('leapYears', () => {
|
|
|
|
test('works with non century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(1996)).toBe(true);
|
|
|
|
});
|
2023-02-01 23:58:58 +00:00
|
|
|
test('works with non century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(1997)).toBe(false);
|
|
|
|
});
|
2023-02-01 23:58:58 +00:00
|
|
|
test('works with ridiculously futuristic non century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(34992)).toBe(true);
|
|
|
|
});
|
2023-02-01 23:58:58 +00:00
|
|
|
test('works with century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(1900)).toBe(false);
|
|
|
|
});
|
2023-02-01 23:58:58 +00:00
|
|
|
test('works with century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(1600)).toBe(true);
|
|
|
|
});
|
2023-02-01 23:58:58 +00:00
|
|
|
test('works with century years', () => {
|
2023-01-21 17:53:41 +00:00
|
|
|
expect(leapYears(700)).toBe(false);
|
|
|
|
});
|
2022-02-20 19:07:44 +00:00
|
|
|
});
|