Show real sourcelines in stacktraces when tests fail
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 06 Apr 2017 15:27:33 +0200
changeset 92 00e2a49e82c5
parent 91 6cf66f3cedb5
child 93 b3c8e9f42ad3
Show real sourcelines in stacktraces when tests fail
karma.conf.js
package.json
webpack/test.config.js
--- a/karma.conf.js	Thu Apr 06 14:53:09 2017 +0200
+++ b/karma.conf.js	Thu Apr 06 15:27:33 2017 +0200
@@ -30,7 +30,7 @@
     // preprocess matching files before serving them to the browser
     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
     preprocessors: {
-        '**/*.js':['webpack'],
+        '**/*.js':['webpack', 'sourcemap'],
     },
 
 
--- a/package.json	Thu Apr 06 14:53:09 2017 +0200
+++ b/package.json	Thu Apr 06 15:27:33 2017 +0200
@@ -34,6 +34,7 @@
     "karma-junit-reporter": "^1.2.0",
     "karma-mocha": "^1.3.0",
     "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",
--- a/webpack/test.config.js	Thu Apr 06 14:53:09 2017 +0200
+++ b/webpack/test.config.js	Thu Apr 06 15:27:33 2017 +0200
@@ -10,3 +10,5 @@
     'react/lib/ExecutionEnvironment': 'react',
     'react/lib/ReactContext': 'react',
 });
+
+config.devtool = 'inline-source-map'