odin-javascript-exercises/06_leapYears/solution/leapYears-solution.spec.js

23 lines
659 B
JavaScript
Raw Normal View History

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