changes to jest
This commit is contained in:
parent
6c713cf5f2
commit
513646cebf
|
@ -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;
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const leapYears = require('./leapYears')
|
||||
const leapYears = require("./leapYears");
|
||||
|
||||
describe('leapYears', () => {
|
||||
test('works with non century years', () => {
|
||||
describe("leapYears", () => {
|
||||
test("works with non century years", () => {
|
||||
expect(leapYears(1996)).toBe(true);
|
||||
});
|
||||
test.skip('works with non century years', () => {
|
||||
test("works with non century years", () => {
|
||||
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);
|
||||
});
|
||||
test.skip('works with century years', () => {
|
||||
test("works with century years", () => {
|
||||
expect(leapYears(1900)).toBe(false);
|
||||
});
|
||||
test.skip('works with century years', () => {
|
||||
test("works with century years", () => {
|
||||
expect(leapYears(1600)).toBe(true);
|
||||
});
|
||||
test.skip('works with century years', () => {
|
||||
test("works with century years", () => {
|
||||
expect(leapYears(700)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue