You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Project Summary
4
4
5
-
In this project, we'll learn about TTD ( test driven development ). Using Jest, we'll create Unit Tests for methods and properties inside of `cart.js`. After the Unit Tests are created, we'll create the solution for `cart.js` to make all the Unit Tests pass. The TTD approach can lead to more confidence that the code you create meets all technical requirements.
5
+
In this project, we'll learn about TDD ( test driven development ). Using Jest, we'll create Unit Tests for methods and properties inside of `cart.js`. After the Unit Tests are created, we'll create the solution for `cart.js` to make all the Unit Tests pass. The TDD approach can lead to more confidence that the code you create meets all technical requirements.
6
6
7
7
## Step 1
8
8
@@ -12,7 +12,7 @@ In this step, we'll create a `package.json` and install `jest` so that we can cr
12
12
13
13
### Instructions
14
14
15
-
* Initialze a `package.json` file.
15
+
* Initialize a `package.json` file.
16
16
* Install and save `jest` to development dependencies.
17
17
* Modify the `test` script inside of `package.json` to be `"jest"`.
18
18
@@ -90,7 +90,7 @@ const cart = require('./cart');
90
90
const cars = require('./data/cars.js');
91
91
```
92
92
93
-
When we require `cart.js`, we gain access to all of its exported methods and properties. You can view how many methods and properties there are by opening `cart.js`. We can group the test cases specifically for the two cart properties into a group called `Cart Properties:` and we can group the test caes specifically for the three methods into a group called `Cart Methods:`. In Jest, you can create test groups by using the `describe` keyword. The first `argument` for `describe` is the name of the group and the second `argument` is a callback function that holds all the test cases.
93
+
When we require `cart.js`, we gain access to all of its exported methods and properties. You can view how many methods and properties there are by opening `cart.js`. We can group the test cases specifically for the two cart properties into a group called `Cart Properties:` and we can group the test cases specifically for the three methods into a group called `Cart Methods:`. In Jest, you can create test groups by using the `describe` keyword. The first `argument` for `describe` is the name of the group and the second `argument` is a callback function that holds all the test cases.
94
94
95
95
```js
96
96
const cart = require('./cart');
@@ -351,7 +351,7 @@ test('removeFromCart() should decrease the total property.', function() {
351
351
Let's move on to our last method: `checkout`. This method should be pretty easy to test. All we need to do here is add a random number of cars to our cart and then call the `checkout` method. We can then `expect` `cart` equals an empty array and we can then `expect` `total` equals `0`.
352
352
353
353
```js
354
-
test('checkout() shoud empty the cart array and set total to 0.', function() {
354
+
test('checkout() should empty the cart array and set total to 0.', function() {
0 commit comments