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