Skip to content

Commit f41168a

Browse files
committed
Tests: Code coverage via Istanbul and report to coveralls.io
1 parent 6173fb9 commit f41168a

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ node_js:
33
- 0.8
44
before_script:
55
- npm install -g grunt-cli
6+
script: npm run-script ci
67
branches:
78
only:
89
- master
9-
- 1.3-stable
1010
env:
1111
- JQUERIES=1.8.3
1212
- JQUERIES=1.10.2

Gruntfile.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ module.exports = function( grunt ) {
353353
keepSpecialComments: 0
354354
},
355355
minify: {
356-
files: files.getMinifiedCSSFiles( dist ),
356+
files: files.getMinifiedCSSFiles( dist )
357357
}
358358
},
359359

@@ -515,7 +515,7 @@ module.exports = function( grunt ) {
515515
content = content.replace( re, "" );
516516
}
517517
return content;
518-
},
518+
}
519519
},
520520
files: {
521521
// WARNING: This will be modified by the config:copy:noversion task
@@ -636,11 +636,23 @@ module.exports = function( grunt ) {
636636

637637
qunit: {
638638
options: {
639-
timeout: 30000
639+
timeout: 30000,
640+
"--web-security": "no",
641+
coverage: {
642+
baseUrl: ".",
643+
src: [
644+
"js/**/*.js",
645+
"!js/jquery.js",
646+
"!js/**/jquery.ui*.js",
647+
"!js/jquery.hashchange.js"
648+
],
649+
instrumentedFiles: "temp/",
650+
htmlReport: "build/report/coverage",
651+
lcovReport: "build/report/lcov",
652+
linesThresholdPct: 0
653+
}
640654
},
641655

642-
files: {},
643-
644656
http: {
645657
options: {
646658
urls: (function() {
@@ -716,6 +728,14 @@ module.exports = function( grunt ) {
716728
}
717729
},
718730

731+
coveralls: {
732+
all: {
733+
734+
// LCOV coverage file relevant to every target
735+
src: "build/report/lcov/lcov.info"
736+
}
737+
},
738+
719739
clean: {
720740
dist: [ dist ],
721741
git: [ path.join( dist, "git" ) ],
@@ -733,7 +753,8 @@ module.exports = function( grunt ) {
733753
grunt.loadNpmTasks( "grunt-contrib-concat" );
734754
grunt.loadNpmTasks( "grunt-contrib-connect" );
735755
grunt.loadNpmTasks( "grunt-contrib-cssmin" );
736-
grunt.loadNpmTasks( "grunt-contrib-qunit" );
756+
grunt.loadNpmTasks( "grunt-coveralls" );
757+
grunt.loadNpmTasks( "grunt-qunit-istanbul" );
737758
grunt.loadNpmTasks( "grunt-contrib-requirejs" );
738759
grunt.loadNpmTasks( "grunt-contrib-uglify" );
739760
grunt.loadNpmTasks( "grunt-git-authors" );

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# jQuery Mobile [![Build Status](https://travis-ci.org/jquery/jquery-mobile.png?branch=master)](https://travis-ci.org/jquery/jquery-mobile)
1+
# jQuery Mobile [![Build Status](https://travis-ci.org/jquery/jquery-mobile.png?branch=master)](https://travis-ci.org/jquery/jquery-mobile) [![Coverage Status](https://coveralls.io/repos/jquery/jquery-mobile/badge.png?branch=istanbul)](https://coveralls.io/r/jquery/jquery-mobile?branch=istanbul)
22

33
This is the main repository for the jQuery Mobile project. From the [official website](http://jquerymobile.com):
44

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,21 @@
2525
"devDependencies": {
2626
"async": "0.2.9",
2727
"jsdom": "0.8.3",
28-
"grunt": "0.4.1",
28+
"grunt": "0.4.2",
2929
"grunt-contrib-clean": "0.5.0",
3030
"grunt-contrib-compress": "0.5.2",
3131
"grunt-contrib-concat": "0.3.0",
3232
"grunt-contrib-connect": "0.3.0",
3333
"grunt-contrib-copy": "0.4.1",
3434
"grunt-contrib-cssmin": "0.6.1",
3535
"grunt-contrib-jshint": "0.6.3",
36-
"grunt-contrib-qunit": "0.2.2",
3736
"grunt-contrib-requirejs": "0.4.1",
3837
"grunt-contrib-uglify": "0.2.6",
38+
"grunt-coveralls": "0.1.0",
3939
"grunt-git-authors": "1.2.0",
4040
"grunt-qunit-junit": "0.1.0-alpha2",
4141
"grunt-hash-manifest": "0.4.0",
42+
"grunt-qunit-istanbul": "0.3.0",
4243
"optimist": "0.6.0",
4344
"requirejs": "2.1.8",
4445
"scp": "0.0.3",
@@ -52,6 +53,7 @@
5253
"node": ">= 0.8.0"
5354
},
5455
"scripts": {
56+
"ci": "grunt test && grunt coveralls",
5557
"test": "grunt test",
5658
"lint": "grunt jshint"
5759
},

0 commit comments

Comments
 (0)