Skip to content

Commit 482e40d

Browse files
committed
Fix issue where CI build would hang running karma watch task
1 parent 51daa59 commit 482e40d

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ before_script:
1414
- npm install -g bower grunt-cli
1515
- bower install
1616

17-
script: "grunt karma --verbose"
17+
script: "grunt --verbose"

Gruntfile.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ module.exports = function (grunt) {
88

99
var testConfig = function (configFile, customOptions) {
1010
var options = { configFile: configFile, keepalive: true };
11-
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
11+
var travisOptions = process.env.TRAVIS && {
12+
browsers: ['Firefox'],
13+
reporters: ['dots', 'coverage'],
14+
singleRun: true
15+
};
1216
return grunt.util._.extend(options, customOptions, travisOptions);
1317
};
1418

@@ -28,15 +32,12 @@ module.exports = function (grunt) {
2832
},
2933
karma: {
3034
unit: {
31-
options: testConfig('karma.conf.js')
32-
},
33-
watch: {
3435
options: testConfig('karma.conf.js',
3536
{
3637
singleRun: false,
3738
autoWatch: true,
3839
keepalive: true,
39-
browsers: ['PhantomJS']
40+
browsers: ['Chrome']
4041
})
4142
}
4243
},

karma.conf.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function (config) {
2727
],
2828

2929
files: [
30-
'bower_components/jquery/jquery.js',
30+
'bower_components/jquery/dist/jquery.js',
3131
'bower_components/moment/moment.js',
3232
'bower_components/bootstrap/dist/js/bootstrap.js',
3333
'bower_components/angular/angular.js',
@@ -45,6 +45,12 @@ module.exports = function (config) {
4545
'**/src/js/*.js': ['coverage']
4646
},
4747

48+
// optionally, configure the reporter
49+
coverageReporter: {
50+
type : 'html',
51+
dir : 'coverage/'
52+
},
53+
4854
// test results reporter to use
4955
// possible values: 'dots', 'progress', 'junit'
5056
reporters: ['progress', 'coverage'],
@@ -87,6 +93,6 @@ module.exports = function (config) {
8793

8894
// Continuous Integration mode
8995
// if true, it capture browsers, run tests and exit
90-
singleRun: true
96+
singleRun: false
9197
});
9298
};

package.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66
"license": "MIT",
77
"homepage": "http://dalelotts.github.io/angular-bootstrap-datetimepicker",
88
"main": "src/js/datetimepicker.js",
9-
"dependencies": {
10-
},
9+
"dependencies": {},
1110
"devDependencies": {
1211
"bower": "latest",
13-
"grunt": "0.4.1",
14-
"grunt-cli": "0.1.10",
15-
"grunt-contrib-jshint": "0.6.4",
16-
"grunt-istanbul-coverage": "0.0.2",
17-
"grunt-karma": "0.6.2",
18-
"karma-coverage": "0.1.0",
19-
"karma-phantomjs-launcher": "~0.1",
20-
"matchdep": "0.1.2",
12+
"grunt": "0.4.4",
13+
14+
"grunt-contrib-jshint": "0.9.2",
15+
"grunt-istanbul-coverage": "0.0.3",
16+
"grunt-karma": "0.8.2",
17+
"karma-chrome-launcher": "^0.1.2",
18+
"karma-coverage": "0.2.1",
19+
"karma-firefox-launcher": "^0.1.3",
20+
"karma-jasmine": "^0.1.5",
21+
"karma-phantomjs-launcher": "0.1.2",
22+
"matchdep": "0.3.0",
2123
"phantomjs": "^1.9.7-1"
2224
},
25+
"peerDependencies": {
26+
"grunt-cli": "0.1.13"
27+
},
2328
"scripts": {
2429
"test": "grunt --verbose",
2530
"postinstall": "./node_modules/bower/bin/bower install"

0 commit comments

Comments
 (0)