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