Browse Source

fix(tests): source maps for Karma

dev1
paweldomas 4 years ago
parent
commit
902f02af8f
4 changed files with 13 additions and 2 deletions
  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 View File

30
         preprocessors: {
30
         preprocessors: {
31
             'node_modules/core-js/**': [ 'webpack' ],
31
             'node_modules/core-js/**': [ 'webpack' ],
32
             './index.js': [ 'webpack' ],
32
             './index.js': [ 'webpack' ],
33
-            './**/*.spec.js': [ 'webpack' ]
33
+            './**/*.spec.js': [ 'webpack', 'sourcemap' ]
34
         },
34
         },
35
 
35
 
36
         // test results reporter to use
36
         // test results reporter to use

+ 9
- 0
package-lock.json View File

5392
         "jasmine-core": "^3.5.0"
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
     "karma-webpack": {
5404
     "karma-webpack": {
5396
       "version": "4.0.2",
5405
       "version": "4.0.2",
5397
       "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-4.0.2.tgz",
5406
       "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-4.0.2.tgz",

+ 1
- 0
package.json View File

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

+ 2
- 1
webpack.config.js View File

10
         || process.argv.indexOf('--optimize-minimize') !== -1;
10
         || process.argv.indexOf('--optimize-minimize') !== -1;
11
 
11
 
12
 const config = {
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
     mode: minimize ? 'production' : 'development',
15
     mode: minimize ? 'production' : 'development',
15
     module: {
16
     module: {
16
         rules: [ {
17
         rules: [ {

Loading…
Cancel
Save