Skip to content

Commit 3db8457

Browse files
committed
updates to match changes to tests
1 parent 2dee0da commit 3db8457

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Problem Statement
44

5-
We've covered a lot of JavaScript concepts, but now it's time to put the concepts in to practice. We'll start with variables.
5+
We've covered a lot of JavaScript concepts, but now it's time to put the concepts into practice. We'll start with variables.
66

77
## Objectives
88

@@ -26,8 +26,8 @@ in charge of getting the tests to pass.
2626

2727
### Structure
2828

29-
The structure of this lab where its files and folders are located — looks
30-
roughly like the following:
29+
The structure of this lab — where its files and folders are located
30+
— looks roughly like the following:
3131

3232
```
3333
├── CONTRIBUTING.md
@@ -101,12 +101,11 @@ gather the information that you can. We will also provide instructions in the
101101

102102
## Running the Tests
103103

104-
To run the tests, type `learn` in the terminal part of the Learn IDE.
105-
(The terminal is the part below where you've been coding.)
106-
107-
Running the `learn` command will open up a new tab on your browser, showing the
108-
current status of the tests. For the moment, all of the tests fail. Let's figure
109-
out how to get one of them passing! (The rest will be up to you.)
104+
To run the tests, type `learn` or `learn test` in the terminal. (If you're using
105+
the IDE, the terminal is the part below where you've been coding.) You should
106+
now see the current status of the tests in the terminal. For the moment, all of
107+
the tests fail. Let's figure out how to get one of them passing! (The rest will
108+
be up to you.)
110109

111110
To get our first test to pass, we can open up our `index.js` file, and write the
112111
following:
@@ -115,11 +114,11 @@ following:
115114
let companyName = 'Scuber';
116115
```
117116

118-
Great, our first test is now passing. However, the second test that is also about
119-
`companyName` is not yet passing. It's not passing because, it expects a change to
120-
`companyName` to throw a `TypeError`. It sounds like it wants `companyName` to
121-
be declared using a different keyword than the `let` keyword - it needs a
122-
keyword that is used for variables that can't be changed...
117+
If you run `learn` again, you'll see that our first test is now passing.
118+
However, the second test, which is also about `companyName`, is not yet passing.
119+
It's not passing because it expects `companyName` to be declared using a
120+
different keyword than the `let` keyword — it needs a keyword that is used
121+
for variables that can't be changed...
123122

124123
Continue to work through the problems below. Keep in mind the general workflow
125124
for a lab:
@@ -128,18 +127,18 @@ for a lab:
128127
2. Read the errors; vocalize what they're asking you to do.
129128
3. Write code; repeat steps 1 and 2 often until a test passes.
130129
4. Repeat as needed for further tests.
131-
5. Run `learn submit` when finished!
130+
5. Unless you're working in Canvas, run `learn submit` when finished!
132131

133132
## Working Through the Problems
134133

135134
If you open up `test/indexTest.js`, you will see the tasks in front of you:
136135

137-
+ `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.
138-
+ 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.
139-
+ `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.
140-
+ `companyCeo` - Here, we are getting more practice with declaring variables. Once again, a reassignment should not throw an error.
136+
+ `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, run `learn` and you will see the first test in this lab is passing.
137+
+ In the next `it` function call, we are still describing `companyName`. This time, it says it `is defined as a const`. The next line of code tests this. 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.
138+
+ `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 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.
139+
+ `companyCeo` - Here, we are getting more practice with declaring variables. Once again, we want to use a variable declaration that allows reassignment.
141140

142141
## Resources
143142

144-
- [MDN: Let](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let)
145-
- [MDN: Const](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)
143+
+ [MDN: Let](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let)
144+
+ [MDN: Const](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)

0 commit comments

Comments
 (0)