Use karma-mocha-reporter instead of karma-spec-reporter
authorFrank Bessou <frank.bessou@logilab.fr>
Wed, 12 Apr 2017 14:16:28 +0200
changeset 105 ebe07e45cd21
parent 104 80bf81f6463c
child 106 5a56c4dcfd25
Use karma-mocha-reporter instead of karma-spec-reporter This reporter provide better output: - diff between expected and actual value - summary at the end of each run
karma.conf.js
package.json
--- a/karma.conf.js	Tue Apr 11 15:15:27 2017 +0200
+++ b/karma.conf.js	Wed Apr 12 14:16:28 2017 +0200
@@ -38,7 +38,7 @@
     // test results reporter to use
     // possible values: 'dots', 'progress'
     // available reporters: https://npmjs.org/browse/keyword/karma-reporter
-    reporters: ['progress', 'junit'],
+    reporters: ['mocha', 'junit'],
 
     junitReporter: {
         outputDir: 'reports',
@@ -46,6 +46,9 @@
         useBrowserName: false,
     },
 
+    mochaReporter: {
+        showDiff: true,
+    },
 
     // web server port
     port: 9876,
--- a/package.json	Tue Apr 11 15:15:27 2017 +0200
+++ b/package.json	Wed Apr 12 14:16:28 2017 +0200
@@ -23,6 +23,7 @@
     "babel-preset-react": "^6.5.0",
     "babel-register": "^6.7.2",
     "chai": "^3.5.0",
+    "diff": "^3.2.0",
     "enzyme": "^2.4.1",
     "eslint": "^3.11.1",
     "eslint-plugin-react": "^6.7.1",
@@ -33,9 +34,9 @@
     "karma-firefox-launcher": "^1.0.1",
     "karma-junit-reporter": "^1.2.0",
     "karma-mocha": "^1.3.0",
+    "karma-mocha-reporter": "^2.2.3",
     "karma-phantomjs-launcher": "^1.0.4",
     "karma-sourcemap-loader": "^0.3.7",
-    "karma-spec-reporter": "0.0.30",
     "karma-webpack": "^2.0.3",
     "mocha": "^2.5.3",
     "react-addons-test-utils": "^15.3.2",
@@ -45,7 +46,7 @@
     "webpack-dev-server": "^2.4.2"
   },
   "scripts": {
-    "test:watch": "karma start --reporters spec",
+    "test:watch": "karma start --reporters mocha",
     "test": "karma start --single-run || true",
     "build": "webpack --progress --config development.config.js",
     "watch": "webpack --progress -d --watch",