Merge branch 'main' into km-testing-jest-2
This commit is contained in:
commit
a0977c9295
|
@ -4,19 +4,19 @@ describe('findTheOldest', () => {
|
||||||
test('finds the oldest person!', () => {
|
test('finds the oldest person!', () => {
|
||||||
const people = [
|
const people = [
|
||||||
{
|
{
|
||||||
name: 'Carly',
|
name: "Carly",
|
||||||
yearOfBirth: 1942,
|
yearOfBirth: 1942,
|
||||||
yearOfDeath: 1970,
|
yearOfDeath: 1970,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ray',
|
name: "Ray",
|
||||||
yearOfBirth: 1962,
|
yearOfBirth: 1962,
|
||||||
yearOfDeath: 2011
|
yearOfDeath: 2011,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Jane',
|
name: "Jane",
|
||||||
yearOfBirth: 1912,
|
yearOfBirth: 1912,
|
||||||
yearOfDeath: 1941
|
yearOfDeath: 1941,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
expect(findTheOldest(people).name).toBe('Ray');
|
expect(findTheOldest(people).name).toBe('Ray');
|
||||||
|
@ -24,18 +24,18 @@ describe('findTheOldest', () => {
|
||||||
test.skip('finds the oldest person if someone is still living', () => {
|
test.skip('finds the oldest person if someone is still living', () => {
|
||||||
const people = [
|
const people = [
|
||||||
{
|
{
|
||||||
name: 'Carly',
|
name: "Carly",
|
||||||
yearOfBirth: 2018,
|
yearOfBirth: 2018,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ray',
|
name: "Ray",
|
||||||
yearOfBirth: 1962,
|
yearOfBirth: 1962,
|
||||||
yearOfDeath: 2011
|
yearOfDeath: 2011,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Jane',
|
name: "Jane",
|
||||||
yearOfBirth: 1912,
|
yearOfBirth: 1912,
|
||||||
yearOfDeath: 1941
|
yearOfDeath: 1941,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
expect(findTheOldest(people).name).toBe('Ray');
|
expect(findTheOldest(people).name).toBe('Ray');
|
||||||
|
@ -43,21 +43,20 @@ describe('findTheOldest', () => {
|
||||||
test.skip('finds the oldest person if the OLDEST is still living', () => {
|
test.skip('finds the oldest person if the OLDEST is still living', () => {
|
||||||
const people = [
|
const people = [
|
||||||
{
|
{
|
||||||
name: 'Carly',
|
name: "Carly",
|
||||||
yearOfBirth: 1066,
|
yearOfBirth: 1066,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ray',
|
name: "Ray",
|
||||||
yearOfBirth: 1962,
|
yearOfBirth: 1962,
|
||||||
yearOfDeath: 2011
|
yearOfDeath: 2011,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Jane',
|
name: "Jane",
|
||||||
yearOfBirth: 1912,
|
yearOfBirth: 1912,
|
||||||
yearOfDeath: 1941
|
yearOfDeath: 1941,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
expect(findTheOldest(people).name).toBe('Carly');
|
expect(findTheOldest(people).name).toBe('Carly');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,5 +15,4 @@ describe('getTheTitles', () => {
|
||||||
test('gets titles', () => {
|
test('gets titles', () => {
|
||||||
expect(getTheTitles(books)).toEqual(['Book','Book2']);
|
expect(getTheTitles(books)).toEqual(['Book','Book2']);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const palindromes = function() {
|
const palindromes = function () {};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,4 @@ describe('palindromes', () => {
|
||||||
test.skip('doesn\'t just always return true', () => {
|
test.skip('doesn\'t just always return true', () => {
|
||||||
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
|
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe('repeatString', () => {
|
||||||
|
|
||||||
// DO NOT use Math.floor(Math.random() * 1000) in your code,
|
// DO NOT use Math.floor(Math.random() * 1000) in your code,
|
||||||
// this test generates a random number, then passes it into your code with a function parameter.
|
// this test generates a random number, then passes it into your code with a function parameter.
|
||||||
// If this doesn't make sense, you should go read about functions here: https://www.theodinproject.com/courses/web-development-101/lessons/fundamentals-part-3
|
// If this doesn't make sense, you should go read about functions here: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/fundamentals-part-3
|
||||||
const number = Math.floor(Math.random() * 1000)
|
const number = Math.floor(Math.random() * 1000)
|
||||||
/*The .match(/((hey))/g).length is a regex that will count the number of heys
|
/*The .match(/((hey))/g).length is a regex that will count the number of heys
|
||||||
in the result, which if your function works correctly will equal the number that
|
in the result, which if your function works correctly will equal the number that
|
||||||
|
|
|
@ -19,5 +19,4 @@ describe('snakeCase', () => {
|
||||||
test.skip('works with WTF case', () => {
|
test.skip('works with WTF case', () => {
|
||||||
expect(snakeCase('SnAkE..CaSe..Is..AwEsOmE')).toEqual('snake_case_is_awesome');
|
expect(snakeCase('SnAkE..CaSe..Is..AwEsOmE')).toEqual('snake_case_is_awesome');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue