Hi All,

I have recently updated my code base to used angular's latest version 1.3.0 
my test fails right after; Here is the log

Chrome 37.0.2062 (Windows 7) Controller: MainCtrl isActive return true when 
path are the same FAILED
        TypeError: undefined is not a function
            at $LocationProvider.$get 
(C:/project/obligor/app/lib/angular/angular.js:11072:34)
            at Object.invoke 
(C:/project/obligor/app/lib/angular/angular.js:4152:17)
            at C:/project/obligor/app/lib/angular/angular.js:3970:37
            at getService 
(C:/project/obligor/app/lib/angular/angular.js:4111:39)
            at Object.invoke 
(C:/project/obligor/app/lib/angular/angular.js:4143:13)
            at workFn 
(C:/project/obligor/app/lib/angular-mocks/angular-mocks.js:2161:20)
        Error: Declaration Location
            at window.inject.angular.mock.inject 
(C:/project/obligor/app/lib/angular-mocks/angular-mocks.j
            at null.<anonymous> 
(C:/project/obligor/test/spec/controllers/main.js:9:16)
            at C:/project/obligor/test/spec/controllers/main.js:3:1
        TypeError: Cannot read property 'path' of undefined
            at null.<anonymous> 
(C:/project/obligor/test/spec/controllers/main.js:23:16)
PhantomJS 1.9.7 (Windows 7) Controller: MainCtrl isActive return true when 
path are the same FAILED
        TypeError: 'undefined' is not a function (evaluating 
'$browser.state()')
            at C:/project/obligor/app/lib/angular/angular.js:11072
            at invoke (C:/project/obligor/app/lib/angular/angular.js:4152)
            at C:/project/obligor/app/lib/angular/angular.js:3970
            at getService 
(C:/project/obligor/app/lib/angular/angular.js:4111)
            at invoke (C:/project/obligor/app/lib/angular/angular.js:4143)
            at workFn 
(C:/project/obligor/app/lib/angular-mocks/angular-mocks.js:2161)
        undefined
        TypeError: 'undefined' is not an object (evaluating 'location.path')

My simple test

'use strict';

describe('Controller: MainCtrl', function () {
       
   var location, scope;
   
   beforeEach(module('myModule'));
   
   beforeEach(inject(function($controller,$rootScope,$location){
      
  location =$location;
  scope = $rootScope.$new();
  $controller('NavigationController',{
  $scope: scope
  });
   }));
   
   
   
describe('isActive',function(){
   
   it('return true when path are the same',function(){
          location.path('/test'); // this is where the error start
  expect(scope.isActive('/test')).toBeTruthy();
   
   });
   
});
   
});

Please help because, I really need to upgrade my code to 1.3.0 

Thanks








-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to