diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/guide/dev_guide.unit-testing.ngdoc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc index a14ddd39..79af465b 100644 --- a/docs/content/guide/dev_guide.unit-testing.ngdoc +++ b/docs/content/guide/dev_guide.unit-testing.ngdoc @@ -92,8 +92,8 @@ State & Singletons} The class above is hard to test since we have to change global state: <pre> -var oldXHR = glabal.xhr; -glabal.xhr = function mockXHR() {}; +var oldXHR = global.xhr; +global.xhr = function mockXHR() {}; var myClass = new MyClass(); myClass.doWork(); // assert that mockXHR got called with the right arguments @@ -126,12 +126,12 @@ there is only one global variable to be reset). The class above is hard to test since we have to change global state: <pre> -var oldServiceLocator = glabal.serviceLocator; -glabal.serviceLocator.set('xhr', function mockXHR() {}); +var oldServiceLocator = global.serviceLocator; +global.serviceLocator.set('xhr', function mockXHR() {}); var myClass = new MyClass(); myClass.doWork(); // assert that mockXHR got called with the right arguments -glabal.serviceLocator = oldServiceLocator; // if you forget this bad things will happen +global.serviceLocator = oldServiceLocator; // if you forget this bad things will happen </pre> |
