Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TypeError: Cannot read property '*' of undefined
- //mycontroller.js
- angular.module('mymodule' []{
- .controller('ctrl',['dep1', 'dep2', 'depn']function(dep1, dep2, depn)
- $scope.list = {
- fname : routeParam.fname,
- lname : routeParam.lname,
- },
- .....
- })
- //mycontroller-spec.js
- describe('test suite", function (){)
- beforeEach('mymodule'));
- beforeEach(inject(function($controller, $rootScope) {
- scope = $rootScope.$new();
- ctrl = $controller('ctrl', {
- $scope: scope,
- .......
- ......
- it('should return test scope', function() {
- //expect(scope.list.fname).toEqual('');
- expect(scope.list.fname).toBe(undefined);
- //expect(scope.list.lname).toBe(undefined);
- });
- But if i run this test spec I am getting the following error
- "TypeError: Cannot read property 'fname' of undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement