Skip to content

Commit d93c7d5

Browse files
committed
refactor(karma): update file globs, jade preprocessor only when filters.jade
1 parent 8a76da2 commit d93c7d5

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

Diff for: app/templates/_package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"grunt-contrib-jshint": "~0.11.2",
5050
"grunt-contrib-uglify": "^0.9.1",
5151
"grunt-contrib-watch": "~0.6.1",<% if (filters.jade) { %>
52-
"grunt-contrib-jade": "^0.15.0",<% } %><% if (filters.less) { %>
52+
"grunt-contrib-jade": "^0.15.0",
53+
"karma-ng-jade2js-preprocessor": "^0.2.0",<% } %><% if (filters.less) { %>
5354
"grunt-contrib-less": "^1.0.0",<% } %><% if(filters.babel) { %>
5455
"karma-babel-preprocessor": "^5.2.1",<% } %>
5556
"grunt-babel": "~5.0.0",
@@ -95,7 +96,6 @@
9596
"karma-firefox-launcher": "~0.1.6",
9697
"karma-script-launcher": "~0.1.0",
9798
"karma-html2js-preprocessor": "~0.1.0",
98-
"karma-ng-jade2js-preprocessor": "^0.2.0",
9999
"karma-chrome-launcher": "~0.2.0",
100100
"requirejs": "~2.1.11",
101101
"karma-requirejs": "~0.2.2",

Diff for: app/templates/karma.conf.js

+8-15
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,25 @@ module.exports = function(config) {
2222
// endbower<% if (filters.socketio) { %>
2323
'node_modules/socket.io-client/socket.io.js',<% } %>
2424
'client/app/app.js',
25-
'client/app/**/*.js',
26-
'client/components/**/*.js',
27-
'client/app/**/*.jade',
28-
'client/components/**/*.jade',
29-
'client/app/**/*.html',
30-
'client/components/**/*.html'
25+
'client/{app,components}/**/*.module.js',
26+
'client/{app,components}/**/*.js',
27+
'client/{app,components}/**/*.<%= filters.jade ? '{jade,html}' : 'html' %>'
3128
],
3229

3330
preprocessors: {
34-
'**/*.jade': 'ng-jade2js',
35-
'**/*.html': 'html2js',<% if(filters.babel) { %>
31+
'**/*.html': 'html2js'<% if (filters.jade) { %>,
32+
'**/*.jade': 'ng-jade2js'<% } if (filters.babel) { %>,
3633
'client/{app,components}/**/*.js': 'babel'<% } %>
3734
},
3835

3936
ngHtml2JsPreprocessor: {
4037
stripPrefix: 'client/'
41-
},
38+
},<% if (filters.jade) { %>
4239

4340
ngJade2JsPreprocessor: {
4441
stripPrefix: 'client/'
45-
},
42+
},<% } if (filters.babel) { %>
4643

47-
<% if(filters.babel) { %>
4844
babelPreprocessor: {
4945
options: {
5046
sourceMap: 'inline'
@@ -55,8 +51,7 @@ module.exports = function(config) {
5551
sourceFileName: function (file) {
5652
return file.originalPath;
5753
}
58-
},
59-
<% } %>
54+
},<% } %>
6055

6156
// list of files / patterns to exclude
6257
exclude: [],
@@ -80,7 +75,6 @@ module.exports = function(config) {
8075
// enable / disable watching file and executing tests whenever any file changes
8176
autoWatch: false,
8277

83-
8478
// Start these browsers, currently available:
8579
// - Chrome
8680
// - ChromeCanary
@@ -91,7 +85,6 @@ module.exports = function(config) {
9185
// - IE (only Windows)
9286
browsers: ['PhantomJS'],
9387

94-
9588
// Continuous Integration mode
9689
// if true, it capture browsers, run tests and exit
9790
singleRun: false

0 commit comments

Comments
 (0)