leap.test.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { isLeap } from './leap'
  2. // eslint-disable-next-line no-global-assign
  3. xit = it
  4. describe('A leap year', () => {
  5. it('year not divisible by 4 in common year', () => {
  6. expect(isLeap(2015)).toBe(false)
  7. })
  8. xit('year divisible by 2, not divisible by 4 in common year', () => {
  9. expect(isLeap(1970)).toBe(false)
  10. })
  11. xit('year divisible by 4, not divisible by 100 in leap year', () => {
  12. expect(isLeap(1996)).toBe(true)
  13. })
  14. xit('year divisible by 4 and 5 is still a leap year', () => {
  15. expect(isLeap(1960)).toBe(true)
  16. })
  17. xit('year divisible by 100, not divisible by 400 in common year', () => {
  18. expect(isLeap(2100)).toBe(false)
  19. })
  20. xit('year divisible by 100 but not by 3 is still not a leap year', () => {
  21. expect(isLeap(1900)).toBe(false)
  22. })
  23. xit('year divisible by 400 in leap year', () => {
  24. expect(isLeap(2000)).toBe(true)
  25. })
  26. xit('year divisible by 400 but not by 125 is still a leap year', () => {
  27. expect(isLeap(2400)).toBe(true)
  28. })
  29. xit('year divisible by 200, not divisible by 400 in common year', () => {
  30. expect(isLeap(1800)).toBe(false)
  31. })
  32. })