@@ -42,10 +42,10 @@ There are several ways in which you can get a hold of a dependency:
42
42
1. You could create it using the `new` operator.
43
43
2. You could look for it in a well known place, also known as global singleton.
44
44
3. You could ask a registry (also known as service registry) for it. (But how do you get a hold of
45
- the registry? Must likely by looking it up in a well known place. See #2)
45
+ the registry? Most likely by looking it up in a well known place. See #2)
46
46
4. You could expect that it be handed to you.
47
47
48
- Out of the list above only the last option is testable. Let's look at why:
48
+ Out of the four options in the list above, only the last one is testable. Let's look at why:
49
49
50
50
### Using the `new` operator
51
51
@@ -131,7 +131,7 @@ function MyClass() {
131
131
}
132
132
</pre>
133
133
134
- However, where dose the serviceRegistry come from? if it is:
134
+ However, where does the serviceRegistry come from? if it is:
135
135
* `new`-ed up, the the test has no chance to reset the services for testing
136
136
* global look-up, then the service returned is global as well (but resetting is easier, since
137
137
there is only one global variable to be reset).
@@ -251,7 +251,7 @@ and the test is straight forward
251
251
var pc = new PasswordCtrl();
252
252
pc.password('abc');
253
253
pc.grade();
254
- expect(span .strength).toEqual('weak');
254
+ expect(pc .strength).toEqual('weak');
255
255
</pre>
256
256
257
257
Notice that the test is not only much shorter but it is easier to follow what is going on. We say
0 commit comments