jenkins-bot has submitted this change and it was merged.

Change subject: Use Istanbul for code coverage
......................................................................


Use Istanbul for code coverage

* Replace grunt-contrib-qunit with grunt-qunit-istanbul (special fork)

Added `grunt qunit:cov` to test in debug mode and generate reports, and `grunt
qunit:all` to test in normal mode without coverage.

Reports are spit at tests/report/index.html

Change-Id: Ib0d8dfc72f86ce3878f5d0b8943e1a38bf7b3703
---
M .gitignore
M Gruntfile.js
M package.json
3 files changed, 23 insertions(+), 4 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitignore b/.gitignore
index dbd9cc8..e900ac6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 composer.phar
 .DS_Store
 composer.lock
+tests/report
diff --git a/Gruntfile.js b/Gruntfile.js
index cb1b80d..ef26aa8 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -10,7 +10,7 @@
 
        grunt.loadNpmTasks( 'grunt-contrib-jshint' );
        grunt.loadNpmTasks( 'grunt-jscs' );
-       grunt.loadNpmTasks( 'grunt-contrib-qunit' );
+       grunt.loadNpmTasks( 'grunt-qunit-istanbul' );
        grunt.loadNpmTasks( 'grunt-contrib-watch' );
        grunt.loadNpmTasks( 'grunt-notify' );
        grunt.loadNpmTasks( 'grunt-svg2png' );
@@ -45,7 +45,25 @@
                qunit: {
                        all: {
                                options: {
-                                       urls: [ '<%= URL 
%>Special:JavaScriptTest/qunit?useformat=mobile<%= QUNIT_FILTER %><%= 
QUNIT_MODULE %>' ]
+                                       urls: [
+                                               '<%= URL 
%>Special:JavaScriptTest/qunit?useformat=mobile' +
+                                               '<%= QUNIT_FILTER %><%= 
QUNIT_MODULE %>'
+                                       ]
+                               }
+                       },
+                       cov: {
+                               options: {
+                                       urls: [
+                                               '<%= URL 
%>Special:JavaScriptTest/qunit?debug=true&useformat=mobile' +
+                                               '<%= QUNIT_FILTER %><%= 
QUNIT_MODULE %>'
+                                       ],
+                                       coverage: {
+                                               prefixUrl: 'w/', // Prefix url 
on the server
+                                               baseUrl: '../../', // Path to 
assets from the server (extensions/Mobile...)
+                                               src: [ '<%= files.js %>', '!<%= 
files.jsExternals %>' ],
+                                               instrumentedFiles: 
'tests/report/tmp',
+                                               htmlReport: 'tests/report'
+                                       }
                                }
                        }
                },
diff --git a/package.json b/package.json
index ed1bf35..cebd175 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
                "grunt-jscs": "0.8.1",
                "js-beautify": "^1.5.4",
                "grunt-notify": "^0.3.1",
-               "grunt-contrib-qunit": "^0.5.2",
-               "grunt-contrib-watch": "0.6.1"
+               "grunt-contrib-watch": "0.6.1",
+               "grunt-qunit-istanbul": 
"git+https://github.com/joakin/grunt-qunit-istanbul.git#prefix-url";
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/174037
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0d8dfc72f86ce3878f5d0b8943e1a38bf7b3703
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to