changes to jest

This commit is contained in:
Justin O'Reilly 2021-05-21 18:41:06 -04:00
parent 6c713cf5f2
commit 513646cebf
2 changed files with 16 additions and 10 deletions

View File

@ -1,5 +1,11 @@
const leapYears = function() { const leapYears = function (checkLeapYear) {
if (checkLeapYear % 100 === 0 && checkLeapYear % 400 === 0) {
return true;
} else if (checkLeapYear % 4 === 0 && checkLeapYear % 100 !== 0) {
return true;
} else {
return false;
}
}; };
module.exports = leapYears; module.exports = leapYears;

View File

@ -1,22 +1,22 @@
const leapYears = require('./leapYears') const leapYears = require("./leapYears");
describe('leapYears', () => { describe("leapYears", () => {
test('works with non century years', () => { test("works with non century years", () => {
expect(leapYears(1996)).toBe(true); expect(leapYears(1996)).toBe(true);
}); });
test.skip('works with non century years', () => { test("works with non century years", () => {
expect(leapYears(1997)).toBe(false); expect(leapYears(1997)).toBe(false);
}); });
test.skip('works with ridiculously futuristic non century years', () => { test("works with ridiculously futuristic non century years", () => {
expect(leapYears(34992)).toBe(true); expect(leapYears(34992)).toBe(true);
}); });
test.skip('works with century years', () => { test("works with century years", () => {
expect(leapYears(1900)).toBe(false); expect(leapYears(1900)).toBe(false);
}); });
test.skip('works with century years', () => { test("works with century years", () => {
expect(leapYears(1600)).toBe(true); expect(leapYears(1600)).toBe(true);
}); });
test.skip('works with century years', () => { test("works with century years", () => {
expect(leapYears(700)).toBe(false); expect(leapYears(700)).toBe(false);
}); });
}); });