Files
odin-javascript-exercises/findTheOldest/findTheOldest.spec.js
T
Tatiana b2f2211321 Revert "Resolve merge conflicts"
This reverts commit 61338e0ca0, reversing
changes made to b9983073cc.
2021-05-08 11:27:13 -07:00

63 lines
1.3 KiB
JavaScript

let findTheOldest = require("./findTheOldest");
describe("findTheOldest", function () {
it("finds the oldest person!", function () {
const people = [
{
name: "Carly",
yearOfBirth: 1942,
yearOfDeath: 1970,
},
{
name: "Ray",
yearOfBirth: 1962,
yearOfDeath: 2011,
},
{
name: "Jane",
yearOfBirth: 1912,
yearOfDeath: 1941,
},
];
expect(findTheOldest(people).name).toEqual("Ray");
});
xit("finds the oldest person if someone is still living", function () {
const people = [
{
name: "Carly",
yearOfBirth: 2018,
},
{
name: "Ray",
yearOfBirth: 1962,
yearOfDeath: 2011,
},
{
name: "Jane",
yearOfBirth: 1912,
yearOfDeath: 1941,
},
];
expect(findTheOldest(people).name).toEqual("Ray");
});
xit("finds the oldest person if the OLDEST is still living", function () {
const people = [
{
name: "Carly",
yearOfBirth: 1066,
},
{
name: "Ray",
yearOfBirth: 1962,
yearOfDeath: 2011,
},
{
name: "Jane",
yearOfBirth: 1912,
yearOfDeath: 1941,
},
];
expect(findTheOldest(people).name).toEqual("Carly");
});
});