@@ -12,11 +12,13 @@ module.exports = function (config) {
1212 // frameworks to use
1313 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
1414 frameworks : [ 'jasmine' , 'browserify' ] ,
15+
1516 browserify : {
16- debug : true
17+ debug : true ,
18+ transform :[ 'browserify-istanbul' ] ,
1719 } ,
1820 // list of files patterns to load in the browser
19- // include:false表示不包含这些文件到浏览器中, 注意添加顺序
21+ // false 表示初始化的时候不会使用 script 标签直接将相关 js 引入到浏览器,需要自己写代码加载, 注意添加顺序
2022 files : [
2123 /***legacy文件夹下的源码添加至此***/
2224 { pattern : 'src/legacy/libs/SuperMap_Basic-8.1.1-14426.js' , include : false } ,
@@ -55,7 +57,7 @@ module.exports = function (config) {
5557 //'test/common/iServer/FacilityAnalystUpstream3DServiceSpec.js',
5658 'test/common/iServer/FieldStatisticServiceSpec.js' ,
5759 'test/common/iServer/FindClosestFacilitiesServiceSpec.js' ,
58- 'test/common/iServer/FindLocationServiceSpec.js' ,
60+ /* 'test/common/iServer/FindLocationServiceSpec.js',
5961 'test/common/iServer/FindMTSPPathsServiceSpec.js',
6062 'test/common/iServer/FindPathServiceSpec.js',
6163 'test/common/iServer/FindServiceAreasServiceSpec.js',
@@ -94,7 +96,7 @@ module.exports = function (config) {
9496 'test/common/iServer/TransferPathServiceSpec.js',
9597 'test/common/iServer/TransferSolutionServiceSpec.js',
9698 'test/common/iServer/UpdateEdgeWeightServiceSpec.js',
97- 'test/common/iServer/UpdateTurnNodeWeightServiceSpec.js'
99+ 'test/common/iServer/UpdateTurnNodeWeightServiceSpec.js'*/
98100
99101 /*Leaflet、OL3、legacy文件夹测试代码,暂未添加*/
100102
@@ -114,7 +116,7 @@ module.exports = function (config) {
114116 './node_modules/whatwg-fetch/fetch.js' : [ 'browserify' ] ,
115117 './node_modules/fetch-jsonp/build/fetch-jsonp.js' : [ 'browserify' ] ,
116118 'src/legacy/libs/Lang/*.js' : [ 'browserify' ] ,
117- 'src/common/**/*.js' : [ 'browserify' , 'coverage' ] ,
119+ 'src/common/**/*.js' : [ 'browserify' , /* 'coverage'*/ ] ,
118120 'test/common/**/*Spec.js' : [ 'browserify' ]
119121 } ,
120122
@@ -131,10 +133,18 @@ module.exports = function (config) {
131133 coverageReporter : {
132134 dir : 'testcoverage/' ,
133135 reporters : [
134- { type : 'lcov' , subdir : '.' }
136+ { type : 'lcov' , subdir : '.' } ,
135137 ]
136138 } ,
137139
140+ /* coverageReporter: {
141+ reporters: [
142+ {'type': 'text'},
143+ {'type': 'html', dir: 'testcoverage'},
144+ {'type': 'lcov'}
145+ ]
146+ },*/
147+
138148
139149 // web server port
140150 port : 9876 ,
@@ -162,8 +172,18 @@ module.exports = function (config) {
162172 // if true, Karma captures browsers, runs the tests and exits
163173 singleRun : false ,
164174
175+ /* plugins: [
176+ 'karma-coverage',
177+ 'karma-browserify',
178+ 'karma-chrome-launcher',
179+ 'karma-jasmine',
180+ 'karma-teamcity-reporter',
181+ ],*/
182+
165183 // Concurrency level
166184 // how many browser should be started simultaneous
167- concurrency : Infinity
185+ concurrency : Infinity ,
186+
187+ /* plugins:['karma-sourcemap-loader']*/
168188 } )
169189} ;
0 commit comments