SOLUTION = Solution Plunker
I have tried manually passing the template in testing - is it even good way of doing it ? How to make it passes !!!!!!!
How to write unit test for Simple directive with template-Url without Using Karma . I have tried following after seeing examples on stack-overflow but no success.
Directive
app.directive("crazy", function () { return { restrict: "A", templateUrl:"directivetemplate.html" }; });
Spec
describe('Directive: crazy', function () { beforeEach(module('plunker')); beforeEach(inject(function($templateCache) { var directiveTemplate = null; var req = new XMLHttpRequest(); req.onload = function() { directiveTemplate = this.responseText; }; req.open("get", "directivetemplate.html", false); req.send(); $templateCache.put("directiveTemplate.html", directiveTemplate); })); it('should exist', inject(function ($rootScope, $compile) { element = angular.element('<div crazy></div>'); element = $compile(element)($rootScope); $rootScope.$apply(); expect(element.children().length.toBe(2)); })); });