-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
My karma-unit.conf.js file which started-off this seed, now looks like:
files: [
...
'app/views/*.html'
],
preprocessors: {
'app/views/*.html': ['ng-html2js']
},
ngHtml2JsPreprocessor: {
moduleName: 'views',
stripPrefix: 'app/'
}
I was running grunt:karma:unitCoverage and I kept getting errors like:
Chrome 32.0.1700 (Mac OS X 10.9.2) ERROR
Uncaught SyntaxError: Unexpected token <
at /Users/myUsername/dev/nyApp/app/views/home.html:1
After much trial and error I figured out the way to fix this was to embellish the Gruntfile.js with the preprocessor that had been sitting in karma-unit.conf.js:
karma: {
unitCoverage: {
configFile: './test/karma-unit.conf.js',
preprocessors: {
'app/scripts/*.js': ['coverage'],
'app/views/*.html': ['ng-html2js'] // had to be repeated here
}
Is this because the preprocessor block is getting overridden?
Another suggestion is to alter the seed such that subdirectories would be covered too:
preprocessors: {
//'app/scripts/*.js': ['coverage'], // original
'app/scripts/**/*.js': ['coverage'], // may be a nicer default
'app/views/*.html': ['ng-html2js']
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels