Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit c230699

Browse files
fix(coverage): setup
1 parent 1f557c7 commit c230699

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

‎gulpfile.js‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ var _ = require('lodash');
66
var karma = require('karma').server;
77
var karmaConf = require('./karma.conf.js');
88

9-
gulp.task('test', function(done) {
10-
karma.start(_.assign({}, karmaConf, { singleRun: true }), done);
9+
gulp.task('test', function (done) {
10+
karma.start({
11+
configFile: __dirname + '/karma.conf.js',
12+
singleRun: true
13+
}, done);
1114
});
1215

13-
gulp.task('tdd', function(done) {
14-
karma.start(karmaConf, done);
16+
gulp.task('tdd', function (done) {
17+
karma.start({
18+
configFile: __dirname + '/karma.conf.js'
19+
}, done);
1520
});
1621

1722
gulp.task('jshint', function() {
18-
return gulp.src('./{controllers,decorators,directives,filters,services}/*.js')
23+
return gulp.src('./{controllers,decorators,directives,E2E,filters,services}/*.js')
1924
.pipe(jshint())
2025
.pipe(jshint.reporter(stylish))
2126
.pipe(jshint.reporter('fail'));
2227
});
2328

24-
gulp.task('default', ['jshint', 'test']);
29+
gulp.task('default', ['jshint', 'test']);

‎karma.conf.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ module.exports = function(config) {
4343
],
4444

4545
// plugin list
46-
plugins: ['karma-jasmine','karma-phantomjs-launcher','karma-ng-html2js-preprocessor'],
46+
plugins: ['karma-jasmine','karma-phantomjs-launcher','karma-ng-html2js-preprocessor','karma-coverage'],
4747

4848
// preprocess matching files before serving them to the browser
4949
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
5050
preprocessors: {
51-
'directives/*.html': ['ng-html2js']
51+
'directives/*.html': ['ng-html2js'],
52+
'./{controllers,decorators,directives,E2E,filters,services}/*.js': ['coverage']
5253
},
5354

5455
// Custom ngHtml2JSPreprocessor options

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"jshint-stylish": "^1.0.1",
2323
"karma": "^0.12.28",
2424
"karma-chrome-launcher": "^0.2.0",
25-
"karma-coverage": "^0.2.7",
25+
"karma-coverage": "^0.4.2",
2626
"karma-jasmine": "^0.3.3",
2727
"karma-ng-html2js-preprocessor": "^0.1.2",
2828
"karma-phantomjs-launcher": "^0.1.4",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /