@@ -17,6 +17,14 @@ var util = module.exports = {
17
17
unit : [ 'src/js/core/bootstrap.js' , 'src/js/**/*.js' , 'test/unit/**/*.spec.js' , 'src/features/*/js/**/*.js' , 'src/features/*/test/**/*.spec.js' , '.tmp/template.js' ] ,
18
18
core_unit : [ 'src/js/core/bootstrap.js' , 'src/js/**/*.js' , 'test/unit/**/*.spec.js' , 'src/features/*/js/**/*.js' , '.tmp/template.js' ] ,
19
19
} ,
20
+ testFilesFeature : function ( featureName ) {
21
+ var featurePattern = 'src/features/' + featureName + '/test/**/*.spec.js' ;
22
+
23
+ return {
24
+ unit : [ 'src/js/core/bootstrap.js' , 'src/js/**/*.js' , 'test/unit/**/*.spec.js' , 'src/features/*/js/**/*.js' , featurePattern , '.tmp/template.js' ] ,
25
+ core_unit : util . testDependencies . unit . core_unit
26
+ } ;
27
+ } ,
20
28
21
29
// Return a list of angular files for a specific version
22
30
angularFiles : function ( version ) {
@@ -211,12 +219,20 @@ var util = module.exports = {
211
219
. concat ( util . testFiles . core_unit ) )
212
220
}
213
221
} ) ;
222
+ } else if ( grunt . option ( 'feature' ) ) {
223
+ grunt . config ( 'karma.' + karmaConfigName , {
224
+ options : {
225
+ files : util . testDependencies . unit
226
+ . concat ( util . angularFiles ( version )
227
+ . concat ( util . testFilesFeature ( grunt . option ( 'feature' ) ) . unit ) )
228
+ }
229
+ } ) ;
214
230
} else {
215
231
grunt . config ( 'karma.' + karmaConfigName , {
216
232
options : {
217
233
files : util . testDependencies . unit
218
234
. concat ( util . angularFiles ( version )
219
- . concat ( util . testFiles . unit ) )
235
+ . concat ( util . testFiles . unit ) )
220
236
}
221
237
} ) ;
222
238
}
0 commit comments