8000 Update findTheOldest test to clear ambiguity · mstottrop/javascript-exercises@8bc6e47 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bc6e47

Browse files
committed
Update findTheOldest test to clear ambiguity
1 parent f3a6283 commit 8bc6e47

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

12_findTheOldest/findTheOldest.spec.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,26 @@ describe('findTheOldest', () => {
2121
]
2222
expect(findTheOldest(people).name).toBe('Ray');
2323
});
24-
test('finds the oldest person if yearOfDeath field is not present', () => {
24+
test.skip('finds the oldest person if yearOfDeath field is undefined on a non-oldest person', () => {
25+
const people = [
26+
{
27+
name: "Carly",
28+
yearOfBirth: 2018,
29+
},
30+
{
31+
name: "Ray",
32+
yearOfBirth: 1962,
33+
yearOfDeath: 2011,
34+
},
35+
{
36+
name: "Jane",
37+
yearOfBirth: 1912,
38+
yearOfDeath: 1941,
39+
},
40+
]
41+
expect(findTheOldest(people).name).toBe('Ray');
42+
});
43+
test.skip('finds the oldest person if yearOfDeath field is undefined for the oldest person', () => {
2544
const people = [
2645
{
2746
name: "Carly",

0 commit comments

Comments
 (0)
0