10000 leap years solution · M-Munk/javascript-exercises@7287817 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7287817

Browse files
committed
leap years solution
1 parent c14e462 commit 7287817

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

leapYears/leapYears.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var leapYears = function() {
2-
1+
var leapYears = function(year) {
2+
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 == 0)
33
}
44

55
module.exports = leapYears

leapYears/leapYears.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ describe('leapYears', function() {
44
it('works with non century years', function() {
55
expect(leapYears(1996)).toEqual(true);
66
});
7-
xit('works with non century years', function() {
7+
it('works with non century years', function() {
88
expect(leapYears(1997)).toEqual(false);
99
});
10-
xit('works with ridiculously futuristic non century years', function() {
10+
it('works with ridiculously futuristic non century years', function() {
1111
expect(leapYears(34992)).toEqual(true);
1212
});
13-
xit('works with century years', function() {
13+
it('works with century years', function() {
1414
expect(leapYears(1900)).toEqual(false);
1515
});
16-
xit('works with century years', function() {
16+
it('works with century years', function() {
1717
expect(leapYears(1600)).toEqual(true);
1818
});
19-
xit('works with century years', function() {
19+
it('works with century years', function() {
2020
expect(leapYears(700)).toEqual(false);
2121
});
2222
});

0 commit comments

Comments
 (0)
0