Skip to content

Commit a1c5627

Browse files
committed
Merge branch 'chore/switch-to-jest' into jest-solutions
2 parents 085fd89 + a0977c9 commit a1c5627

File tree

14 files changed

+7362
-76
lines changed

14 files changed

+7362
-76
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before you start you should have a few things installed on your machine:
1414

1515
Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. Some of the exercises have test conditions defined in their spec file that are defined as 'test.skip' compared to 'test'. This is purposeful. After you pass your first 'test', you will change the next 'test.skip' to an 'test' and test your code again. You'll do this until all conditions are satisfied.
1616

17-
**Note**: Due to the way Jest handles failed tests, it will return an etest.skip code of 1 if any tests fail. NPM will interpret this as an error and you may see some `npm ERR!` messages after Jest runs. You can ignore these, or run your test with `npm test exerciseName.spec.js --silent` to supress the errors.
17+
**Note**: Due to the way Jest handles failed tests, it may return an exit code of 1 if any tests fail. NPM will interpret this as an error and you may see some `npm ERR!` messages after Jest runs. You can ignore these, or run your test with `npm test exerciseName.spec.js --silent` to supress the errors.
1818

1919
The first exercise, `helloWorld`, will walk you through the process in-depth.
2020

findTheOldest/findTheOldest.spec.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,59 @@ describe('findTheOldest', () => {
44
test('finds the oldest person!', () => {
55
const people = [
66
{
7-
name: 'Carly',
7+
name: "Carly",
88
yearOfBirth: 1942,
99
yearOfDeath: 1970,
1010
},
1111
{
12-
name: 'Ray',
12+
name: "Ray",
1313
yearOfBirth: 1962,
14-
yearOfDeath: 2011
14+
yearOfDeath: 2011,
1515
},
1616
{
17-
name: 'Jane',
17+
name: "Jane",
1818
yearOfBirth: 1912,
19-
yearOfDeath: 1941
19+
yearOfDeath: 1941,
2020
},
2121
]
2222
expect(findTheOldest(people).name).toBe('Ray');
2323
});
2424
test.skip('finds the oldest person if someone is still living', () => {
2525
const people = [
2626
{
27-
name: 'Carly',
27+
name: "Carly",
2828
yearOfBirth: 2018,
2929
},
3030
{
31-
name: 'Ray',
31+
name: "Ray",
3232
yearOfBirth: 1962,
33-
yearOfDeath: 2011
33+
yearOfDeath: 2011,
3434
},
3535
{
36-
name: 'Jane',
36+
name: "Jane",
3737
yearOfBirth: 1912,
38-
yearOfDeath: 1941
38+
yearOfDeath: 1941,
3939
},
4040
]
4141
expect(findTheOldest(people).name).toBe('Ray');
4242
});
4343
test.skip('finds the oldest person if the OLDEST is still living', () => {
4444
const people = [
4545
{
46-
name: 'Carly',
46+
name: "Carly",
4747
yearOfBirth: 1066,
4848
},
4949
{
50-
name: 'Ray',
50+
name: "Ray",
5151
yearOfBirth: 1962,
52-
yearOfDeath: 2011
52+
yearOfDeath: 2011,
5353
},
5454
{
55-
name: 'Jane',
55+
name: "Jane",
5656
yearOfBirth: 1912,
57-
yearOfDeath: 1941
57+
yearOfDeath: 1941,
5858
},
5959
]
6060
expect(findTheOldest(people).name).toBe('Carly');
6161
});
62-
6362
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let <%= title %> = function() {
22

3-
}
3+
};
44

5-
module.exports = <%= title %>
5+
module.exports = <%= title %>;

generator-exercise/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

getTheTitles/getTheTitles.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ describe('getTheTitles', () => {
1515
test('gets titles', () => {
1616
expect(getTheTitles(books)).toEqual(['Book','Book2']);
1717
});
18-
1918
});

0 commit comments

Comments
 (0)