1- const puppeteer = require ( ' puppeteer' ) ;
1+ const puppeteer = require ( " puppeteer" ) ;
22
33process . env . TEST = true ;
44process . env . NODE_ENV = "test" ;
@@ -9,71 +9,59 @@ const webpackConfig = require("./webpack.config.js")({ production: false, karma:
99delete webpackConfig . entry ;
1010
1111module . exports = config => {
12- "use strict" ;
12+ "use strict" ;
1313
14- var configuration = {
15- basePath : "" ,
16- frameworks : [
17- "mocha" ,
18- "sinon-chai" ,
19- "es6-shim"
20- ] ,
21- files : [
22- { pattern : "./test/index.ts" , include : true } ,
23- { pattern : '**/*.map' , served : true , included : false , watched : true }
24- ] ,
25- preprocessors : {
26- "./test/index.ts" : [ "webpack" ] ,
27- "./**/**/**/**.ts" : [ "sourcemap" ]
28- } ,
29- webpack : webpackConfig ,
30- webpackMiddleware : {
31- noInfo : true
32- } ,
33- plugins : [
34- "karma-webpack" ,
35- "karma-sourcemap-writer" ,
36- "karma-sourcemap-loader" ,
37- "karma-remap-istanbul" ,
38- "karma-mocha-reporter" ,
39- "karma-mocha" ,
40- "karma-sinon-chai" ,
41- "karma-es6-shim" ,
42- "karma-coverage-istanbul-reporter"
43- ] ,
44- mime : {
45- "text/x-typescript" : [ "ts" , "tsx" ]
46- } ,
47- reporters : (
48- config . singleRun ?
49- [ "dots" , "mocha" , "coverage-istanbul" ] :
50- [ "dots" , "mocha" ]
51- ) ,
52- coverageIstanbulReporter : {
53- reports : [ "html" , "lcov" , "lcovonly" , "text-summary" ] ,
54- dir : "coverage" ,
55- fixWebpackSourcePaths : true ,
56- "report-config" : {
57- html : {
58- subdir : "html-report"
59- }
60- }
61- } ,
62- port : 9876 ,
63- colors : true ,
64- logLevel : config . LOG_INFO ,
65- autoWatch : true ,
66- browsers : [ ] ,
67- browserNoActivityTimeout : 50000
68- } ;
14+ var configuration = {
15+ basePath : "" ,
16+ frameworks : [ "mocha" , "sinon-chai" , "es6-shim" ] ,
17+ files : [ { pattern : "./test/index.ts" , include : true } , { pattern : "**/*.map" , served : true , included : false , watched : true } ] ,
18+ preprocessors : {
19+ "./test/index.ts" : [ "webpack" ] ,
20+ "./**/**/**/**.ts" : [ "sourcemap" ]
21+ } ,
22+ webpack : webpackConfig ,
23+ webpackMiddleware : {
24+ noInfo : true
25+ } ,
26+ plugins : [
27+ "karma-webpack" ,
28+ "karma-sourcemap-writer" ,
29+ "karma-sourcemap-loader" ,
30+ "karma-mocha-reporter" ,
31+ "karma-mocha" ,
32+ "karma-sinon-chai" ,
33+ "karma-es6-shim" ,
34+ "karma-coverage-istanbul-reporter"
35+ ] ,
36+ mime : {
37+ "text/x-typescript" : [ "ts" , "tsx" ]
38+ } ,
39+ reporters : config . singleRun ? [ "dots" , "mocha" , "coverage-istanbul" ] : [ "dots" , "mocha" ] ,
40+ coverageIstanbulReporter : {
41+ reports : [ "html" , "lcov" , "lcovonly" , "text-summary" ] ,
42+ dir : "coverage" ,
43+ fixWebpackSourcePaths : true ,
44+ "report-config" : {
45+ html : {
46+ subdir : "html-report"
47+ }
48+ }
49+ } ,
50+ port : 9876 ,
51+ colors : true ,
52+ logLevel : config . LOG_INFO ,
53+ autoWatch : true ,
54+ browsers : [ ] ,
55+ browserNoActivityTimeout : 50000
56+ } ;
6957
70- if ( process . env . TRAVIS ) {
71- configuration . browsers . push ( "ChromeHeadless" ) ;
72- configuration . plugins . push ( "karma-chrome-launcher" ) ;
73- } else {
74- configuration . browsers . push ( "ChromeHeadless" ) ;
75- configuration . plugins . push ( "karma-chrome-launcher" ) ;
76- }
58+ if ( process . env . TRAVIS ) {
59+ configuration . browsers . push ( "ChromeHeadless" ) ;
60+ configuration . plugins . push ( "karma-chrome-launcher" ) ;
61+ } else {
62+ configuration . browsers . push ( "ChromeHeadless" ) ;
63+ configuration . plugins . push ( "karma-chrome-launcher" ) ;
64+ }
7765
78- config . set ( configuration ) ;
66+ config . set ( configuration ) ;
7967} ;
0 commit comments