I'm using cg-angular to scaffold out my project.
I'm testing a directive that uses templateUr, and ng-html2js to load my templates into a module. When I run my test using Chrome as the browser it passes no problem, but when I run it with Phantom I get:
Error: [$injector:modulerr] Failed to instantiate module templates due to:
Here's the relevant part of my Gruntfile:
karma: {
options: {
frameworks: ['jasmine'],
preprocessors: {'directive/**/*.html':['ng-html2js']},
files: [ //this files data is also updated in the watch handler, if updated change there too
'<%= dom_munger.data.appjs %>',
'bower_components/angular-mocks/angular-mocks.js',
'directive/**/*.html',
createFolderGlobs(['*-spec.js'])
],
ngHtml2JsPreprocessor:{
moduleName:'templates'
},
logLevel: 'ERROR',
reporters: ['mocha'],
autoWatch: false, //watching is handled by grunt-contrib-watch
},
all_tests: {
browsers: ['PhantomJS', 'Chrome'],
singleRun:false
},
during_watch:{
browsers: ['PhantomJS'],
singleRun:true
}
}
So running grunt test which runs karma:all_tests, works like a champ. grunt serve which runs karma:during_watch fails.
Is there a way to check if html2js is actually being run?
Edit It's not Phantom. If I run Chrome in the 'during_watch' task it also fails.