Continua a darmi questo errore: Modulo' templates 'non è disponibile! Hai sbagliato a scrivere il nome del modulo o hai dimenticato di caricarlo.Non riesco a ottenere 'karma-ng-html2js-preprocessore'do il suo lavoro
I testare le unità di implementazione delle direttive in diversi progetti Angular e ora non sembra funzionare. Ecco il mio karma.conf
module.exports = function(config){
config.set({
basePath : '../',
files : [
'webapp/lib/bower_components/angular/angular.js',
'webapp/lib/bower_components/angular-route/angular-route.js',
'webapp/lib/bower_components/angular-resource/angular-resource.js',
'webapp/lib/bower_components/angular-animate/angular-animate.js',
'webapp/lib/bower_components/angular-mocks/angular-mocks.js',
'webapp/lib/bower_components/jquery/jquery.js',
'webapp/lib/jasmine-jquery.js',
'webapp/js/components/**/*.html',
'webapp/app.js',
'webapp/js/**/*.js',
'test/unit/**/*.js',
{ pattern: 'webapp/stubs/*', watched: true, served: true, included: false }
],
preprocessors: {
'webapp/js/components/**/*.html': ['ng-html2js']
//'webapp/components/**/.js' : ['coverage']
},
autoWatch : true,
frameworks: ['jasmine'],
browsers : ['Chrome'],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor'
],
junitReporter : {
outputFile: 'test_out/unit.xml',
suite: 'unit'
},
ngHtm2JsPreprocessor: {
moduleName: 'templates'
}
});
};
Sono assolutamente sicuro al 100% di file .html nella posizione specificata. Ho ricontrollato le istruzioni e non verrà caricato: beforeEach(module('templates'));
nel file spec.
Mi manca qualcosa qui? Molto probabilmente :-)
--edit: dimenticato 'js' nel percorso 'webapp/js/components/**/*. Html', ancora non funziona.
Hai visto [questa domanda] (http://stackoverflow.com/q/15214760/3049002)? – glepretre