|
1 | 1 | import { isLeap } from './leap';
|
2 | 2 |
|
3 | 3 | describe('A leap year', () => {
|
4 |
| - test('year not divisible by 4: common year', () => { |
| 4 | + test('year not divisible by 4 in common year', () => { |
5 | 5 | expect(isLeap(2015)).toBe(false);
|
6 | 6 | });
|
7 | 7 |
|
8 |
| - xtest('year divisible by 4, not divisible by 100: leap year', () => { |
9 |
| - expect(isLeap(2016)).toBe(true); |
| 8 | + xtest('year divisible by 2, not divisible by 4 in common year', () => { |
| 9 | + expect(isLeap(1970)).toBe(false); |
10 | 10 | });
|
11 | 11 |
|
12 |
| - xtest('year divisible by 100, not divisible by 400: common year', () => { |
| 12 | + xtest('year divisible by 4, not divisible by 100 in leap year', () => { |
| 13 | + expect(isLeap(1996)).toBe(true); |
| 14 | + }); |
| 15 | + |
| 16 | + xtest('year divisible by 4 and 5 is still a leap year', () => { |
| 17 | + expect(isLeap(1960)).toBe(true); |
| 18 | + }); |
| 19 | + |
| 20 | + xtest('year divisible by 100, not divisible by 400 in common year', () => { |
13 | 21 | expect(isLeap(2100)).toBe(false);
|
14 | 22 | });
|
15 | 23 |
|
16 |
| - xtest('year divisible by 400: leap year', () => { |
| 24 | + xtest('year divisible by 100 but not by 3 is still not a leap year', () => { |
| 25 | + expect(isLeap(1900)).toBe(false); |
| 26 | + }); |
| 27 | + |
| 28 | + xtest('year divisible by 400 in leap year', () => { |
17 | 29 | expect(isLeap(2000)).toBe(true);
|
18 | 30 | });
|
19 | 31 |
|
20 |
| - xtest('year divisible by 200, not divisible by 400: common year', () => { |
| 32 | + xtest('year divisible by 400 but not by 125 is still a leap year', () => { |
| 33 | + expect(isLeap(2400)).toBe(true); |
| 34 | + }); |
| 35 | + |
| 36 | + xtest('year divisible by 200, not divisible by 400 in common year', () => { |
21 | 37 | expect(isLeap(1800)).toBe(false);
|
22 | 38 | });
|
23 | 39 | });
|
0 commit comments