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
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -21,21 +21,21 @@ The structure of this lab — where its files and folders are located — looks
21
21
├── node_modules/
22
22
├── package.json
23
23
└── test
24
-
└── index-test.js
24
+
└── indexTest.js
25
25
```
26
26
27
-
All labs will more or less have the same structure. (And READMEs, for that matter, will still have CONTRIBUTING.md, LICENSE.md, and README.md files.)
27
+
All labs will more or less have the same structure. (And non-lab lessons, for that matter, will still have CONTRIBUTING.md, LICENSE.md, and README.md files.)
28
28
29
29
### Code-along
30
-
For now, open up `index.js` in your text editor. If you're using the Learn IDE, click the "Open" button in the top right hand corner of the lesson. If you open up that "js-basic-variables-lab" folder, you'll see a list of files (along with a test/ directory). Click `index.js`, and it will open in the editor.
30
+
For now, open up `index.js` in your text editor. If you're using the Learn IDE, click the blue "Open" button in the top right hand corner of the lesson. If you open up that `js-basics-variables-lab/` directory, you'll see a list of files (along with a `test/` directory). Click `index.js`, and it will open in the editor.
31
31
32
32
In `index.js`, you should see, well, nothing. We'll fix that soon.
33
33
34
-
Now open up `test/index-test.js`. Hey, there's something! What's all of this stuff doing?
34
+
Now open up `test/indexTest.js`. Hey, there's something! What's all of this stuff doing?
35
35
36
-
**Note: The `test/index-test.js` has great info that we want to look at, but do not edit this file otherwise you may have extra difficulty passing this lab.**
36
+
**Note: The `test/indexTest.js` has great info that we want to look at, but do not edit this file otherwise you may have extra difficulty passing this lab.**
37
37
38
-
A few lines down in the `test/index-test.js` file you will see:
38
+
A few lines down in the `test/indexTest.js` file you will see:
39
39
```js
40
40
describe('index.js', function () {
41
41
// there's stuff in here, too
@@ -58,7 +58,7 @@ it('is set as Scuber', function () {
58
58
59
59
Here, we can see that it expects `companyName` to equal `Scuber`. That `expect` and `to.equal` are essentially doing the same thing as `companyName == 'Scuber'`. In other words, `expect(companyName).to.equal('Scuber')` is running code that will have this first test pass if `companyName` equals `Scuber` and fail if it does not.
60
60
61
-
Don't worry too much yet if it's hard to understand what is happening inside of the `test/indexTest.js` file. But it's a good idea to open up the file, and gather the information that you can. We will also provide Instructions in the `Readme.md` file that will allow you to complete the lab (as we do in this lab below).
61
+
Don't worry too much yet if it's hard to understand what is happening inside of the `test/indexTest.js` file. But it's a good idea to open up the file, and gather the information that you can. We will also provide Instructions in the `README.md` file that will allow you to complete the lab (as we do in this lab below).
62
62
63
63
## Running the tests
64
64
To run the tests, simply type `learn` in the terminal part of the Learn IDE. (The terminal is the part below where you've been coding.)
@@ -81,9 +81,9 @@ Ok, so we'll let you work through the problems below. But in summary here is you
81
81
82
82
## Working through the problems
83
83
If you open up `test/indexTest.js`, you will see the tasks in front of you:
84
-
+`companyName` - Inside the `test/indexTest`, look inside of the word `describe` where the tests are trying to indicate that this test is describing the `companyName` variable. The `it` word that comes afterwords, tells us the features of `companyName`. In the first `it` function call, it says that `it` (companyName) `is set as Scuber`. In the next line, you can see that the test checks to make sure this occurs by seeing if `companyName` equals `Scuber`. So this means that you need to go to your `index.js` file and declare a variable named `companyName` and set it equal to `Scuber`. Once you do that, if `learn` is running, you will see the first test in this lab as passing.
85
-
In the next `it` function call, we are still describing `companyName`. This time, it says it `raises error if the companyName is changed`. The next line of code tests this. It's ok if some of the code in that line are confusing. Just know that the code attempts to change `companyName` to a different value, and that this reassignment to throw an error. So you need to make sure that you are using the correct variable type such that reassigning the variable would throw an error.
86
-
+`mostProfitableNeighborhood` - Here we need to declare another variable, `mostProfitableNeighborhood` and assign it to `Chelsea`. In the next `it` function call, you can see that our tests ensure that `mostProfitableNeighborhood` does not throw an error when reassigned. So you need to make sure that you are using the correct variable type such that reassigning the `mostProfitableNeighborhood`would not throw an error.
84
+
+`companyName` - Inside the `test/indexTest.js` file, look inside of the word `describe` where the tests are trying to indicate that this test is describing the `companyName` variable. The `it` word that comes afterwards, tells us the features of `companyName`. In the first `it` function call, it says that `it` (companyName) `is set as Scuber`. In the next line, you can see that the test checks to make sure this occurs by seeing if `companyName` equals `Scuber`. So this means that you need to go to your `index.js` file and declare a variable named `companyName` and set it equal to `Scuber`. Once you do that, if `learn` is running, you will see the first test in this lab as passing.
85
+
In the next `it` function call, we are still describing `companyName`. This time, it says it `raises error if the companyName is changed`. The next line of code tests this. It's ok if some of the code in that line is confusing. Just know that the code attempts to change `companyName` to a different value, and that this reassignment should throw an error. So you need to make sure that you are using the correct type of variable declaration such that attempting to reassign the variable throws an error.
86
+
+`mostProfitableNeighborhood` - Here we need to declare another variable, `mostProfitableNeighborhood` and assign to it the string `'Chelsea'`. In the next `it` function call, you can see that our tests ensure that `mostProfitableNeighborhood` does not throw an error when reassigned. So you need to make sure that you are using the correct type of variable declaration such that assigning a new value to `mostProfitableNeighborhood`doesn't throw an error.
87
87
+`companyCeo` - Here, we are getting more practice with declaring variables. Once again, a reassignment should not throw an error.
0 commit comments