| Total Complexity | 5 |
| Complexity/F | 5 |
| Lines of Code | 101 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 3 |
| 1 | const loaders = require('../webpack/loaders'); |
||
| 2 | const preLoaders = require('../webpack/preloaders'); |
||
| 3 | |||
| 4 | const BROWSERS = process.argv && process.argv.indexOf('--browser') !== -1 |
||
| 5 | ? ['jsdom', 'Chrome'] |
||
| 6 | : ['jsdom']; |
||
| 7 | |||
| 8 | const COVERAGE = process.argv && process.argv.indexOf('--coverage') !== -1; |
||
| 9 | |||
| 10 | const SINGLE_RUN = process.argv |
||
| 11 | && process.argv.indexOf('--no-single-run') === -1; |
||
| 12 | |||
| 13 | const PRELOADERS = COVERAGE ? preLoaders : []; |
||
| 14 | |||
| 15 | const REPORTERS = COVERAGE |
||
| 16 | ? ['spec', 'coverage'] |
||
| 17 | : ['spec']; |
||
| 18 | |||
| 19 | module.exports = function exports(config) { |
||
| 20 | config.set({ |
||
| 21 | browsers: BROWSERS, |
||
| 22 | files: [ |
||
| 23 | './../webpack/webpack.test.js' |
||
| 24 | ], |
||
| 25 | client: { |
||
| 26 | captureConsole: false |
||
| 27 | }, |
||
| 28 | frameworks: ['chai', 'mocha', 'es6-shim', 'sinon-chai'], |
||
| 29 | plugins: [ |
||
| 30 | 'karma-chrome-launcher', |
||
| 31 | 'karma-chai', |
||
| 32 | 'karma-coverage', |
||
| 33 | 'karma-mocha', |
||
| 34 | 'karma-mocha-reporter', |
||
| 35 | 'karma-es6-shim', |
||
| 36 | 'karma-webpack', |
||
| 37 | 'karma-babel-preprocessor', |
||
| 38 | 'karma-jsdom-launcher', |
||
| 39 | 'karma-sourcemap-loader', |
||
| 40 | 'karma-sinon-chai', |
||
| 41 | 'karma-spec-reporter' |
||
| 42 | ], |
||
| 43 | |||
| 44 | preprocessors: { |
||
| 45 | './../webpack/webpack.test.js': ['babel', 'webpack', 'sourcemap'] |
||
| 46 | }, |
||
| 47 | |||
| 48 | babelPreprocessor: { |
||
| 49 | options: { |
||
| 50 | presets: ['es2015'] |
||
| 51 | } |
||
| 52 | }, |
||
| 53 | reporters: REPORTERS, |
||
| 54 | specReporter: { |
||
| 55 | maxLogLines: 20, |
||
| 56 | suppressErrorSummary: false, |
||
| 57 | suppressFailed: false, |
||
| 58 | suppressPassed: false, |
||
| 59 | suppressSkipped: false |
||
| 60 | }, |
||
| 61 | singleRun: SINGLE_RUN, |
||
| 62 | webpack: { |
||
| 63 | isparta: { |
||
| 64 | embedSource: true, |
||
| 65 | noAutoWrap: true, |
||
| 66 | babel: { |
||
| 67 | presets: ['es2015', 'stage-0', 'react'] |
||
| 68 | } |
||
| 69 | }, |
||
| 70 | resolve: { |
||
| 71 | extensions: ['', '.js', '.jsx', '.styl'] |
||
| 72 | }, |
||
| 73 | module: { |
||
| 74 | preLoaders: PRELOADERS, |
||
| 75 | loaders: loaders |
||
| 76 | }, |
||
| 77 | externals: { |
||
| 78 | cheerio: 'window', |
||
| 79 | 'react/lib/ExecutionEnvironment': true, |
||
| 80 | 'react/lib/ReactContext': true |
||
| 81 | }, |
||
| 82 | target: 'web', |
||
| 83 | node: { |
||
| 84 | fs: 'empty' |
||
| 85 | }, |
||
| 86 | devServer: { |
||
| 87 | quiet: false |
||
| 88 | } |
||
| 89 | }, |
||
| 90 | webpackMiddleware: { |
||
| 91 | noInfo: true, |
||
| 92 | quiet: true |
||
| 93 | }, |
||
| 94 | coverageReporter: { |
||
| 95 | reporters: [ |
||
| 96 | { type: 'text' }, |
||
| 97 | { type: 'lcovonly', subdir: './../../' } |
||
| 98 | ] |
||
| 99 | } |
||
| 100 | }); |
||
| 101 | }; |
||
| 102 |