Last active
July 3, 2020 14:28
-
-
Save marcoemrich/c5b0efca2ddfcef37b93347ebbbdf685 to your computer and use it in GitHub Desktop.
JS-Testing: leap year parameterized spec
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.each( | |
[2016, 1984, 4] | |
)( | |
'it is divisible by 4 but not by 100 (eg. %i)', | |
year => expect(isLeapYear(year)).toBeTruthy() | |
); | |
it.each( | |
[2400, 2000, 400] | |
)('it is divisible by 400 (eg. %i)', | |
year => expect(isLeapYear(year)).toBeTruthy() | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment