angular directive unit testing with jasmine with template and link <p>I have a directive as below which i want to cover as part of my jasmine unit test but not sure how to get the template value and the values inside the link in my test case. This is the first time i am trying to unit test a directive.</p> <pre><code>angular.module('newFrame', ['ngResource']) .directive('newFrame', [ function () { function onAdd() { $log.info('Clicked onAdd()'); } return { restrict: 'E', replace: 'true', transclude: true, scope: { filter: '=', expand: '=' }, template: '&lt;div class="voice "&gt;' + '&lt;section class="module"&gt;' + '&lt;h3&gt;All Frames (00:11) - Summary View&lt;/h3&gt;' + '&lt;button class="btn" ng-disabled="isDisabled" ng-hide="isReadOnly" ng-click="onAdd()"&gt;Add a frame&lt;/button&gt;' + '&lt;/section&gt;' + '&lt;/div&gt;', link: function (scope) { scope.isDisabled = false; scope.isReadOnly = false; scope.onAdd = onAdd(); } }; } ]); </code></pre>