Apologies if this has been posted before, I couldn't find anything related while searching.
I've got a couple directives that use templateUrl to load their templates from a partial. In order for these directives to work, I've just changed the templateUrl to be a root-relative path:
templateUrl: '/static/app/partials/grid-directive.html'
basePath = '../src/';
files = [
// ...
'static/app/**/*.html'
];
preprocessors = {
'**/*.html': 'html2js'
};
Unfortunately, now that I've made the paths root-relative, it seems that Karma no longer understands to match the requested templateUrl against the pre-processed module, which is loaded with the non-root-relative string:
beforeEach( module('static/app/partials/grid-directive.html') );
Adding the / at the start of the module path causes an error because the module cannot be found, and removing it causes the test to error out with Error: Unexpected request: GET /static/app/partials/grid-directive.html
How can I allow Karma to be aware of how to match these requests against the loaded, pre-processed partial's module?