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
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ JavaScript Logging Lab
12
12
13
13
Welcome to your first JavaScript lab! You'll notice a few new things in this lesson that we haven't encountered before. Don't worry, we'll walk you through them.
14
14
15
-
### Why test?
15
+
### Tests...
16
16
17
-
When we want to run an experiment, we need to develop a hypothesis and we need to test it. So if we want to experiment with whether adding salt to ice water makes it hotter or colder, we need to design an experiment that controls for all of the other variables: we need to _isolate_ our experiment from parts of its environment that aren't relevant to what we hope to test.
17
+
The first new thing you'll notice is tests. When we want to run an experiment, we need to develop a hypothesis and we need to test it. So if we want to experiment with whether adding salt to ice water makes it hotter or colder, we need to design an experiment that controls for all of the other variables: we need to _isolate_ our experiment from parts of its environment that aren't relevant to what we hope to test.
18
18
19
-
In programming, tests pick up on the discipline's computer science background. We run tests to verify that our programs behave the way we think they do. Tests help us identify bugs, and they give us a sense of the health of our applications.
19
+
In programming, tests place the scientific method into computer science. We run tests to verify that our programs behave the way we think they do. Tests help us identify bugs, and they give us a sense of the health of our applications.
20
20
21
21
On Learn, we use tests as teaching tools. Just like in a normal coding environment, we use tests to describe the program's behavior. Unlike in a normal coding environment, you, not we, are in charge of getting the tests to pass — that is, making the app behave like we expect it to.
This might be a bit bewildering, but all we're doing is referencing different _libraries_ that help us run your tests. A library is code that someone else (usually multiple someone elses) wrote for our use. Note that `require` won't work out of the box in the browser. We're actually running our tests in a different _environment_. (Remember the sandbox analogy from earlier? It's just like that.)
67
+
This might be a bit bewildering, but at this point, we don't need to be able to write any of this code, or even understand every line perfectly. All we need is to understand enough so that we can get a sense of what the test is asking us to accomplish, so that we can make the test pass. Let's go through it.
68
+
69
+
In these first lines, all we're doing is referencing different _libraries_ that help us run your tests. A library is code that someone else (usually multiple someone elses) wrote for our use. Note that `require` won't work out of the box in the browser. We're actually running our tests in a different _environment_. (Remember the sandbox analogy from earlier? It's just like that.)
68
70
69
71
A little farther down the page, you'll see
70
72
@@ -116,7 +118,7 @@ In `index.js`, add a call to `console.error()` — you can call it with anything
116
118
console.error("HALP!")
117
119
```
118
120
119
-
Because it seems sufficiently dire.
121
+
Because it seems sufficiently dire. Remember to save your file.
120
122
121
123
Anyway, let's run the tests again. In the Learn IDE's terminal, run
122
124
@@ -151,6 +153,8 @@ and some are errors (something broke, and we need to recover).
151
153
Your job is to identify a way of sending each kind of message. Hint: in
152
154
JavaScript, you'll probably find ways of telling users things with `console`.
153
155
156
+
And again, remember to save your files before you re-run your tests.
157
+
154
158
When all of your tests pass, be sure to run `learn submit` to move on to the next lesson.
0 commit comments