Kaynağa Gözat

fix(tests): source maps for Karma

master
paweldomas 4 yıl önce
ebeveyn
işleme
902f02af8f
4 değiştirilmiş dosya ile 13 ekleme ve 2 silme
  1. 1
    1
      karma.conf.js
  2. 9
    0
      package-lock.json
  3. 1
    0
      package.json
  4. 2
    1
      webpack.config.js

+ 1
- 1
karma.conf.js Dosyayı Görüntüle

@@ -30,7 +30,7 @@ module.exports = function(config) {
30 30
         preprocessors: {
31 31
             'node_modules/core-js/**': [ 'webpack' ],
32 32
             './index.js': [ 'webpack' ],
33
-            './**/*.spec.js': [ 'webpack' ]
33
+            './**/*.spec.js': [ 'webpack', 'sourcemap' ]
34 34
         },
35 35
 
36 36
         // test results reporter to use

+ 9
- 0
package-lock.json Dosyayı Görüntüle

@@ -5392,6 +5392,15 @@
5392 5392
         "jasmine-core": "^3.5.0"
5393 5393
       }
5394 5394
     },
5395
+    "karma-sourcemap-loader": {
5396
+      "version": "0.3.7",
5397
+      "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz",
5398
+      "integrity": "sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg=",
5399
+      "dev": true,
5400
+      "requires": {
5401
+        "graceful-fs": "^4.1.2"
5402
+      }
5403
+    },
5395 5404
     "karma-webpack": {
5396 5405
       "version": "4.0.2",
5397 5406
       "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-4.0.2.tgz",

+ 1
- 0
package.json Dosyayı Görüntüle

@@ -49,6 +49,7 @@
49 49
     "karma": "5.1.1",
50 50
     "karma-chrome-launcher": "3.1.0",
51 51
     "karma-jasmine": "3.1.1",
52
+    "karma-sourcemap-loader": "0.3.7",
52 53
     "karma-webpack": "4.0.2",
53 54
     "string-replace-loader": "2.1.1",
54 55
     "webpack": "4.43.0",

+ 2
- 1
webpack.config.js Dosyayı Görüntüle

@@ -10,7 +10,8 @@ const minimize
10 10
         || process.argv.indexOf('--optimize-minimize') !== -1;
11 11
 
12 12
 const config = {
13
-    devtool: 'source-map',
13
+    // The inline-source-map is used to allow debugging the unit tests with Karma
14
+    devtool: minimize ? 'source-map' : 'inline-source-map',
14 15
     mode: minimize ? 'production' : 'development',
15 16
     module: {
16 17
         rules: [ {

Loading…
İptal
Kaydet