@@ -5,7 +5,6 @@ module.exports = function (config) {
5
5
// 设置测试的超时时间
6
6
7
7
config . set ( {
8
-
9
8
// base path that will be used to resolve all patterns (eg. files, exclude)
10
9
basePath : '' ,
11
10
@@ -22,12 +21,23 @@ module.exports = function (config) {
22
21
browserify : {
23
22
debug : true ,
24
23
transform : [
25
- [ require ( 'babelify' ) , {
26
- global : true ,
27
- presets : [ "@babel/preset-env" ] ,
28
- ignore : [ "../src/classic/libs/**" , "../test/libs/**" , "../node_modules/mapbox-gl/**" , "../node_modules/three/**" , "../node_modules/xlsx/**" , "../node_modules/@turf/**" , "../node_modules/lodash/**" ] ,
29
- plugins : [ 'istanbul' ]
30
- } ] ,
24
+ [
25
+ require ( 'babelify' ) ,
26
+ {
27
+ global : true ,
28
+ presets : [ '@babel/preset-env' ] ,
29
+ ignore : [
30
+ '../src/classic/libs/**' ,
31
+ '../test/libs/**' ,
32
+ '../node_modules/mapbox-gl/**' ,
33
+ '../node_modules/three/**' ,
34
+ '../node_modules/xlsx/**' ,
35
+ '../node_modules/@turf/**' ,
36
+ '../node_modules/lodash/**'
37
+ ] ,
38
+ plugins : [ 'istanbul' ]
39
+ }
40
+ ] ,
31
41
[ require ( 'browserify-css' ) , { global : true } ] ,
32
42
require ( 'browserify-imgify' )
33
43
]
@@ -41,9 +51,9 @@ module.exports = function (config) {
41
51
'./resources/img/**.png' ,
42
52
/***classic的源码***/
43
53
/*由于除了classic其他都不依赖于8c,所以classic 的引入放在最后,以免被common覆盖*/
44
- { pattern : '../src/classic/libs/SuperMap_Basic-8.1.1-17729.js' , include : false } ,
45
- { pattern : '../src/classic/libs/Lang/*.js' , include : false } ,
46
- { pattern : '../src/classic/theme/default/*.css' , include : false } ,
54
+ { pattern : '../src/classic/libs/SuperMap_Basic-8.1.1-17729.js' , include : false } ,
55
+ { pattern : '../src/classic/libs/Lang/*.js' , include : false } ,
56
+ { pattern : '../src/classic/theme/default/*.css' , include : false } ,
47
57
/**测试文件**/
48
58
'./test-main-classic.js' ,
49
59
@@ -53,22 +63,22 @@ module.exports = function (config) {
53
63
'./test-main-common.js' ,
54
64
55
65
/***leaflet的源码***/
56
- { pattern : './libs/workers/TurfWorkerForTest.js' , include : false } ,
57
- { pattern : '../node_modules/leaflet/dist/leaflet.css' , include : false } ,
58
- { pattern : '../src/leaflet/**/**/*.css' , include : false } ,
66
+ { pattern : './libs/workers/TurfWorkerForTest.js' , include : false } ,
67
+ { pattern : '../node_modules/leaflet/dist/leaflet.css' , include : false } ,
68
+ { pattern : '../src/leaflet/**/**/*.css' , include : false } ,
59
69
'../src/leaflet/**/!(index).js' ,
60
70
/**测试文件**/
61
71
'./test-main-leaflet.js' ,
62
72
63
73
/***openlayers的源码***/
64
- { pattern : '../node_modules/ol/ol.css' , include : false } ,
65
- { pattern : '../src/openlayers/**/**/*.css' , include : false } ,
74
+ { pattern : '../node_modules/ol/ol.css' , include : false } ,
75
+ { pattern : '../src/openlayers/**/**/*.css' , include : false } ,
66
76
'../src/openlayers/**/!(index).js' ,
67
77
/**测试文件**/
68
78
'./test-main-openlayers.js' ,
69
79
70
80
/***mapboxgl***/
71
- { pattern : '../node_modules/mapbox-gl/dist/mapbox-gl.css' , include : false } ,
81
+ { pattern : '../node_modules/mapbox-gl/dist/mapbox-gl.css' , include : false } ,
72
82
'../src/mapboxgl/**/!(index).js' ,
73
83
/**测试文件**/
74
84
'./test-main-mapboxgl.js'
@@ -112,7 +122,7 @@ module.exports = function (config) {
112
122
// test results reporter to use
113
123
// possible values: 'dots', 'progress'
114
124
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
115
- reporters : [ 'progress' , 'coverage' , 'teamcity' ] ,
125
+ reporters : [ 'progress' , 'sonarqubeUnit' , ' coverage', 'teamcity' ] ,
116
126
117
127
//最大超时时间
118
128
captureTimeout : 120000 ,
@@ -121,41 +131,37 @@ module.exports = function (config) {
121
131
122
132
coverageReporter : {
123
133
dir : 'testcoverage/' ,
124
- reporters : [
125
- { type : 'lcov' , subdir : '.' }
126
- ]
127
- }
128
- ,
134
+ reporters : [ { type : 'lcov' , subdir : '.' } ]
135
+ } ,
136
+ sonarQubeUnitReporter : {
137
+ sonarQubeVersion : 'LATEST' ,
138
+ outputFile : 'testcoverage/ut_report.xml' ,
139
+ useBrowserName : false
140
+ } ,
129
141
130
142
// web server port
131
143
port : 9876 ,
132
144
133
-
134
145
// enable / disable colors in the output (reporters and logs)
135
146
colors : true ,
136
147
137
-
138
148
// level of logging
139
149
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
140
150
logLevel : config . LOG_INFO ,
141
151
142
-
143
152
// enable / disable watching file and executing tests whenever any file changes
144
153
autoWatch : true ,
145
154
146
-
147
155
// start these browsers
148
156
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
149
157
browsers : [ 'Chrome' ] ,
150
158
151
-
152
159
// Continuous Integration mode
153
160
// if true, Karma captures browsers, runs the tests and exits
154
161
singleRun : false ,
155
162
156
163
// Concurrency level
157
164
// how many browser should be started simultaneous
158
165
concurrency : Infinity
159
-
160
- } )
166
+ } ) ;
161
167
} ;
0 commit comments