mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-16 21:23:23 +09:00
Merge branch 'origin/master' into 'jest'
This commit is contained in:
@@ -1,63 +1,62 @@
|
||||
const findTheOldest = require('./findTheOldest')
|
||||
let findTheOldest = require('./findTheOldest')
|
||||
|
||||
describe('findTheOldest', () => {
|
||||
test('finds the oldest person!', () => {
|
||||
describe('findTheOldest', function() {
|
||||
it('finds the oldest person!', function() {
|
||||
const people = [
|
||||
{
|
||||
name: 'Carly',
|
||||
name: "Carly",
|
||||
yearOfBirth: 1942,
|
||||
yearOfDeath: 1970,
|
||||
},
|
||||
{
|
||||
name: 'Ray',
|
||||
name: "Ray",
|
||||
yearOfBirth: 1962,
|
||||
yearOfDeath: 2011
|
||||
yearOfDeath: 2011,
|
||||
},
|
||||
{
|
||||
name: 'Jane',
|
||||
name: "Jane",
|
||||
yearOfBirth: 1912,
|
||||
yearOfDeath: 1941
|
||||
yearOfDeath: 1941,
|
||||
},
|
||||
]
|
||||
expect(findTheOldest(people).name).toBe('Ray');
|
||||
expect(findTheOldest(people).name).toEqual('Ray');
|
||||
});
|
||||
test.skip('finds the oldest person if someone is still living', () => {
|
||||
xit('finds the oldest person if someone is still living', function() {
|
||||
const people = [
|
||||
{
|
||||
name: 'Carly',
|
||||
name: "Carly",
|
||||
yearOfBirth: 2018,
|
||||
},
|
||||
{
|
||||
name: 'Ray',
|
||||
name: "Ray",
|
||||
yearOfBirth: 1962,
|
||||
yearOfDeath: 2011
|
||||
yearOfDeath: 2011,
|
||||
},
|
||||
{
|
||||
name: 'Jane',
|
||||
name: "Jane",
|
||||
yearOfBirth: 1912,
|
||||
yearOfDeath: 1941
|
||||
yearOfDeath: 1941,
|
||||
},
|
||||
]
|
||||
expect(findTheOldest(people).name).toBe('Ray');
|
||||
expect(findTheOldest(people).name).toEqual('Ray');
|
||||
});
|
||||
test.skip('finds the oldest person if the OLDEST is still living', () => {
|
||||
xit('finds the oldest person if the OLDEST is still living', function() {
|
||||
const people = [
|
||||
{
|
||||
name: 'Carly',
|
||||
name: "Carly",
|
||||
yearOfBirth: 1066,
|
||||
},
|
||||
{
|
||||
name: 'Ray',
|
||||
name: "Ray",
|
||||
yearOfBirth: 1962,
|
||||
yearOfDeath: 2011
|
||||
yearOfDeath: 2011,
|
||||
},
|
||||
{
|
||||
name: 'Jane',
|
||||
name: "Jane",
|
||||
yearOfBirth: 1912,
|
||||
yearOfDeath: 1941
|
||||
yearOfDeath: 1941,
|
||||
},
|
||||
]
|
||||
expect(findTheOldest(people).name).toBe('Carly');
|
||||
expect(findTheOldest(people).name).toEqual('Carly');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user