After fixing this problem for a while and using this time to improve my knowledge and expand my application, I found a solution.
Brief methodological recommendation: since the karma-ng-html2js preprocessor or the karma-html2js preprocessor seem to be working on some other projects, and as they are mentioned in the white paper, I tried a lot (almost all, I think) of the possible combination configuration for running one of them in my test environment. Without success, I came to the conclusion: I have to quit them and find another way.
The solution came from grunt-html2js. Just adding a basic setup to the grunt setup and running grunt, it will generate a module containing all my templates - maybe I will parse it later in more meaningful modules. But from here the work is almost complete. Then I just had to:
- say that the karma for working with the file has other external tools
file: [ {pattern: 'path/to/mytplmodule.js', included: false}, ...] - register the path in my conf request for
path: [ 'templates' : 'path/to/mytplmodule', ...] tests path: [ 'templates' : 'path/to/mytplmodule', ...] - mask it while still requiring conf for tests so that it doesn't load before angular
shim: [ 'templates' : 'angular', ...] - load this module into the test file
define(['templates',...], function(){...}); - get the template of the tested template
beforeEach(module('path/to/mytpl.html')); - add a step to your grunt configuration to make it automatically generated before running the tests.
It's all!
There is a drawback to this approach; it requires extraction or mockery of all templates of other directives used in the proven directive. This can be boring as the number of directives grows. But I prefer this at the moment, as it is not invasive for application code. Maybe later, especially when I turn on javascript compilation in my process, I also moved it from the test to the application.
jibe source share