This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ State & Singletons}
92
92
93
93
The class above is hard to test since we have to change global state:
94
94
<pre>
95
- var oldXHR = glabal .xhr;
96
- glabal .xhr = function mockXHR() {};
95
+ var oldXHR = global .xhr;
96
+ global .xhr = function mockXHR() {};
97
97
var myClass = new MyClass();
98
98
myClass.doWork();
99
99
// assert that mockXHR got called with the right arguments
@@ -126,12 +126,12 @@ there is only one global variable to be reset).
126
126
127
127
The class above is hard to test since we have to change global state:
128
128
<pre>
129
- var oldServiceLocator = glabal .serviceLocator;
130
- glabal .serviceLocator.set('xhr', function mockXHR() {});
129
+ var oldServiceLocator = global .serviceLocator;
130
+ global .serviceLocator.set('xhr', function mockXHR() {});
131
131
var myClass = new MyClass();
132
132
myClass.doWork();
133
133
// assert that mockXHR got called with the right arguments
134
- glabal .serviceLocator = oldServiceLocator; // if you forget this bad things will happen
134
+ global .serviceLocator = oldServiceLocator; // if you forget this bad things will happen
135
135
</pre>
136
136
137
137
You can’t perform that action at this time.
0 commit comments