build: karma now reports with mocha formatter
authorAntoine Musso <hashar@free.fr>
Mon, 6 Mar 2017 20:13:04 +0000 (21:13 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 20 Mar 2017 19:12:18 +0000 (19:12 +0000)
The progress reporter is quite nice to avoid spammy output to the
terminal, but it is not very human friendly when trying to find out what
is breaking.

Mocha has a very nice reporting organized as modules and list items for
each of the tests:

ext.cx.tools.template
  ✖ Equivalent template exists
  ✔ Adapting a template not existing in target language
  ✖ Adapting template having invalid title
  ✖ Template name and params adaptation using templatedata
  ✖ Template params adaptation using templateData - English to French
  ✖ Template params adaptation using templateData - English to Spanish

Add karma-mocha-reporter node module and make it the reporter.

Change-Id: Ic7d848b45e8e5ad3839d8a2bd822b63838319ad7

Gruntfile.js
package.json

index 1ecc2c0..6c56772 100644 (file)
@@ -88,7 +88,7 @@ module.exports = function ( grunt ) {
                                } ],
                                logLevel: 'DEBUG',
                                frameworks: [ 'qunit' ],
-                               reporters: [ 'progress' ],
+                               reporters: [ 'mocha' ],
                                singleRun: true,
                                autoWatch: false,
                                // Some tests in extensions don't yield for more than the default 10s (T89075)
index 5a5635b..2c22395 100644 (file)
@@ -22,6 +22,7 @@
     "karma": "1.1.0",
     "karma-chrome-launcher": "2.0.0",
     "karma-firefox-launcher": "1.0.0",
+    "karma-mocha-reporter": "2.2.3",
     "karma-qunit": "1.0.0",
     "qunitjs": "1.22.0",
     "stylelint-config-wikimedia": "0.4.1",