I swear there is something magical about StackOverflow. I spent an hour getting it to work, gave up, posted this question, and 2min later figured it out.
I made the mistake of moving the files from the files
array to the preprocessors
directive. To get code coverage on a certain file, it needs to be in both places, files
array and the preprocessors
.
My final configuration that works looks like this:
files : [
//3rd Party Code
'bower_components/angular/angular.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angularjs-scope.safeapply/src/Scope.SafeApply.js',
//App-specific Code
'assets/js/app.js',
'assets/js/services.js',
'assets/js/directives.js',
'assets/js/resources.js',
'assets/js/controllers/*.js',
//Test-Specific Code
'node_modules/chai/chai.js',
'test/lib/chai-should.js',
'test/lib/chai-expect.js'
],
preprocessors: {
'**/assets/js/*.js': ['coverage'],
'**/assets/js/controllers/*.js': ['coverage']
},