Last active
July 3, 2020 14:28
-
-
Save marcoemrich/417d3889e60b6614d87ebcbddf9e299e to your computer and use it in GitHub Desktop.
JS-Testing: leap year specs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('leap year specs', () => { | |
describe('A year is a leap year if', () => { | |
it('is divisible by 4 but not by 100', () => { | |
expect(isLeapYear(2016)).toBeTruthy() | |
}); | |
it('is divisible by 400', () => { | |
expect(isLeapYear(2000)).toBeTruthy() | |
}); | |
}); | |
describe('A year is *NOT* a leap year if', () => { | |
it('is not divisible by 4', () => { | |
expect(isLeapYear(3)).toBeFalsy(); | |
}); | |
it('is divisible by 100 but not by 400', () => { | |
expect(isLeapYear(100)).toBeFalsy(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment