lundi 30 novembre 2015

Unit testing directives with nested dependencies

I am an angularJS beginner and I am trying to unit test a directive that has nested dependencies, I have tried different things but the service is always undefined. How do i go about this, I have given the structure of my code below.

  app.directive('directive1', function($compile, service1){
     return {
        restrict : 'EA',
        templateURL: 'directive1.html',
        scope: {

        },
        link: function(scope, element, rootScope){

        },
        controller: function($scope, $element,$rootScope){
        }
    }
 });

First service

apps.factory('service1', function($q, $http, service2){

}

second service

apps.factory('service2', function($q, $http, service3){

}

third service

apps.factory('service3', function($q, $http){

}

Aucun commentaire:

Enregistrer un commentaire