I can\'t make Karma working for directives that have external templates.
Here is my karma configuration file :
pr
You can have the pre-processor cache your templates to a module, which can then be included prior to your tests:
karma.conf.js
files: [
...
'app/**/*.html'
],
preprocessors: {
'app/**/*.html': ['ng-html2js']
},
ngHtml2JsPreprocessor: {
moduleName: 'templates'
},
directive file
...
templateUrl: 'app/path-to-your/template.html',
...
spec file
describe('My directive', function() {
beforeEach(module('templates'));
...
});