javascript - How to Jasmine test code within angular module run block -
I would like to test Jasmine that welcome.go has been called. Welcome to an Angular Service
angular.module ('welcome', []) .Run (function (welcome) {Welcome.go ();}); This is my test so far:
Description ('module: welcome', function () {first (module ('welcome')); (Welcome, 'Go');})); It should call (welcome.go), function () (hopefully (welcome.go)) (hopefully you are welcome. ToHaveBeenCalled ();});}); Note: - Welcome (lowercase w) module
- Welcome (uppercase w) service
Manage to manage. Here is where I came with:
'strict experiment'; Describe ('module: welcome', function () {var is welcome; first each (function () (modules ('welcome', function ($ rendered) {$. Value ('welcome', {go: Jasmine.createSpy ('Go')};}); Injection (_Welcome_) {Welcome = _Welcome_;})}) ('module should call welcome.go on run', function () {Hope (Welcome .go) ToHaveBeen Callalled ();});});
Comments
Post a Comment