1 | var path = require('path');
|
2 |
|
3 | // Karma configuration
|
4 | // Generated on Thu Jun 29 2017 21:00:08 GMT-0400 (EDT)
|
5 |
|
6 | module.exports = function(config) {
|
7 | config.set({
|
8 |
|
9 | // base path that will be used to resolve all patterns (eg. files, exclude)
|
10 | basePath: '',
|
11 |
|
12 | // frameworks to use
|
13 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
14 | frameworks: ['mocha', 'chai'],
|
15 |
|
16 | // list of files / patterns to load in the browser
|
17 | files: [
|
18 | 'src/js/index.js',
|
19 | 'test/offline/**.test.js',
|
20 | 'test/online/**.test.js',
|
21 | // 'test/online/related-genes.test.js',
|
22 | {pattern: 'dist/data/**', watched: false, included: false, served: true, nocache: false}
|
23 | ],
|
24 |
|
25 | proxies: {
|
26 | '/dist/data': '/base/dist/data'
|
27 | },
|
28 |
|
29 | // list of files to exclude
|
30 | exclude: [
|
31 | ],
|
32 |
|
33 | // preprocess matching files before serving them to the browser
|
34 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
35 | preprocessors: {
|
36 | 'src/js/index.js': 'webpack'
|
37 | },
|
38 |
|
39 | webpack: {
|
40 |
|
41 | mode: 'production',
|
42 |
|
43 | performance: {
|
44 | hints: false
|
45 | },
|
46 |
|
47 | module: {
|
48 | rules: [
|
49 | // instrument only testing sources with Istanbul
|
50 | {
|
51 | test: /\.js$/,
|
52 | use: {
|
53 | loader: 'babel-loader',
|
54 | options: {
|
55 | plugins: ['babel-plugin-istanbul']
|
56 | }
|
57 | },
|
58 | include: path.resolve('src/js/')
|
59 | }
|
60 | ]
|
61 | }
|
62 | },
|
63 |
|
64 | // webpackMiddleware: {
|
65 | // stats: {
|
66 | // maxModules: Infinity
|
67 | // }
|
68 | // },
|
69 |
|
70 | // test results reporter to use
|
71 | // possible values: 'dots', 'progress'
|
72 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
73 | reporters: ['progress', 'coverage-istanbul', 'coverage', 'coveralls'],
|
74 |
|
75 | coverageReporter: {
|
76 | type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
|
77 | dir: 'coverage/'
|
78 | },
|
79 |
|
80 | coverageIstanbulReporter: {
|
81 | reports: ['text', 'html'],
|
82 | fixWebpackSourcePaths: true
|
83 | },
|
84 |
|
85 | // web server port
|
86 | port: 9876,
|
87 |
|
88 | // enable / disable colors in the output (reporters and logs)
|
89 | colors: true,
|
90 |
|
91 | // level of logging
|
92 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
93 | logLevel: config.LOG_INFO,
|
94 |
|
95 | // enable / disable watching file and executing tests whenever any file changes
|
96 | autoWatch: true,
|
97 |
|
98 | // start these browsers
|
99 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
100 | browsers: ['Chrome', 'ChromeHeadlessNoSandbox'],
|
101 |
|
102 | customLaunchers: {
|
103 | ChromeHeadlessNoSandbox: {
|
104 | base: 'ChromeHeadless',
|
105 | flags: ['--no-sandbox', '--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36']
|
106 | }
|
107 | },
|
108 |
|
109 | // Continuous Integration mode
|
110 | // if true, Karma captures browsers, runs the tests and exits
|
111 | singleRun: false,
|
112 |
|
113 | // Concurrency level
|
114 | // how many browser should be started simultaneous
|
115 | concurrency: Infinity
|
116 | });
|
117 | };
|