title: Testing factory toBeDefined error
body: <p>Just started jasmine karma.
  the test is failing due to following errors:</p>
  
  <pre><code>PhantomJS 2.1.1 (Mac OS X 0.0.0) dataservice spec should have dataservice be defined FAILED
      Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
      Error: [$injector:unpr] Unknown provider: dataserviceProvider &lt;- dataservice
  </code></pre>
  
  <p>i have provided all dependencies namely $http and $q still getting unknown provider error.
  the factory has been described inside app.core module, which i have
  included into the karma conf file</p>
  
  <p>What am i missing.
  the factory works fine inthe project</p>
  
  <p>unit testing the following http factory</p>
  
  <pre><code>(function() {
      'use strict';
      angular
          .module('app.core', [])
          .factory('dataservice', dataservice);
  
      dataservice.$inject = ['$http', '$q'];
  
      function dataservice($http, $q) {
          return {
              makeRequest: makeRequest,
          };
  
  
          function makeRequest(params) {
              var defer = $q.defer();
              if (params.method == "GET") {
                  $http({
                          method: params.method,
                          url: params.url,
                          headers: params.headers
                      })
                      .then(function(response) {
                              defer.resolve(response);
                          },
                          function(response) {
                              defer.reject(response);
                          })
              }
              if (params.method == "POST") {
                  $http({
                      method: params.method,
                      url: params.url,
                      data: params.parameters,
                      headers: params.headers
                  })
  
                  .then(function(response) {
                              console.log(response);
                              defer.resolve(response);
                          },
                          function(response) {
                              console.log("error");
                              defer.reject(response);
                          })
              }
              return defer.promise;
  
  })();
  </code></pre>
  
  <p>test spec:</p>
  
  <pre><code>(function(){
  'use strict'
  describe('dataservice spec',function(){
      var dataservice;
      beforeEach(function($injector){
          angular.module('app.core');
          //dataservice=$injector.get('dataservice')
      });
      beforeEach(inject(function (_dataservice_,_$http_,_$q_) {
      dataservice = _dataservice_;
      $http=_$http_;
      $q=_$q_;
    }));
      // beforeEach(inject(function() {
   //      var $injector = angular.injector(['app.core']);
   //      dataservice = $injector.get('dataservice');
   //    }));
      it('should have dataservice be defined', function () {
      expect(dataservice).toBeDefined();
    });
  
  })
  
  
  })();
  </code></pre>