Jasmine Karme Unit test - AngularJs Directive is not getting compiled
问题 I am having issues testing angularjs directive. Following is my test: it('should be defined', inject(function($compile,$rootScope){ $scope = $rootScope.$new(); element = $compile('<div><some-directive-name></some-directive-name></div>')($scope); $scope.$digest(); console.log(element[0].outerHTML); expect(element.html()).toBe(template); })); Output for the console.log comes as '<div class="ng-scope"><some-directive-name></some-directive-name></div>' Instead it should be the template URL of