title: Service is undefined, angularJs unit Testing error
body: <p>I have this error shown, i tried many solution at the net, like this example in <a href="http://www.benlesh.com/2013/06/angular-js-unit-testing-services.html" rel="nofollow">http://www.benlesh.com/2013/06/angular-js-unit-testing-services.html</a>, but it seems nothing works.</p>
  
  <p>*****app.js</p>
  
  <pre><code> var app = angular.module('myApp', ['ui.router','ui.bootstrap','dialogs','ngResource']);
  
          app.config(['$stateProvider', '$urlRouterProvider','$resourceProvider', function($stateProvider, $urlRouterProvider,$resourceProvider) {
  
              $urlRouterProvider.otherwise('/');
  
              $stateProvider
                  .state('home', {
                      url:'/',
                      views: {
    ......}})
    }]);
  </code></pre>
  
  <p>*****test.js</p>
  
  <pre><code>     describe('basicService tests', function (){
  
         beforeEach(module('myApp'));
         var basic;
  
         // excuted before each "it" is run.
         beforeEach(inject(function(basicService) {
              basic = basicService;
         }));
  
  
        it('should make text exciting', function (){
          //var result = basic.exciteText('bar');
           expect(basic.exciteText('bar')).toBe('bar!');
        });
  });
  </code></pre>
  
  <p>***** service.js</p>
  
  <pre><code>angular.module('myApp').factory('basicService', function(){
  return {
      exciteText: function(msg) {
          return msg + '!!!'
      }
  };
  });
  </code></pre>
  
  <p>*****error</p>
  
  <pre><code>minErr/&lt;@C:/_Stage/myprojet/src/main/webapp/js/angular.js:63:12
  loadModules/&lt;@C:/_Stage/myprojet/src/main/webapp/js/angular.js:4138:15
  forEach@C:/_Stage/myprojet/src/main/webapp/js/angular.js:323:11
  loadModules@C:/_Stage/myprojet/src/main/webapp/js/angular.js:4099:5
  createInjector@C:/_Stage/myprojet/src/main/webapp/js/angular.js:4025:11
  workFn@C:/_Stage/myprojet/src/main/webapp/js/angular-mocks.js:2425:44
  createStartFn/&lt;@C:/_Stage/myprojet/src/main/webapp/js/adapter.js:317:5
  TypeError: basic is undefined in C:/_Stage/myprojet/src/main/webapp/cportal/component/administration/caFingerPrint/caFingerprintService_test.js (line 20)
  @C:/_Stage/myprojet/src/main/webapp/cportal/component/administration/caFingerPrint/caFingerprintService_test.js:20:9
  createStartFn/&lt;@C:/_Stage/myprojet/src/main/webapp/js/adapter.js:317:5
  </code></pre>
  
  <p>PS: in <em>karma.config.js</em>, i added these files.
  also, i tried <strong>var app = angular.module('myApp', []);</strong> because i didn't include them in '<em>karma.config.js</em>' and i call them like this, </p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>so i thougth its the error, but nothing.Thanks for any help. </p>