Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 1 | // Reference: http://karma-runner.github.io/0.12/config/configuration-file.html |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 2 | module.exports = function karmaConfig(config) { |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 3 | config.set({ |
| 4 | frameworks: [ |
| 5 | // Reference: https://github.com/karma-runner/karma-jasmine |
| 6 | // Set framework to jasmine |
| 7 | 'jasmine' |
| 8 | ], |
| 9 | |
| 10 | reporters: [ |
| 11 | // Reference: https://github.com/mlex/karma-spec-reporter |
| 12 | // Set reporter to print detailed results to console |
| 13 | 'progress', |
| 14 | |
| 15 | // Reference: https://github.com/karma-runner/karma-coverage |
| 16 | // Output code coverage files |
| 17 | 'coverage' |
| 18 | ], |
| 19 | |
| 20 | files: [ |
| 21 | // Grab all files in the app folder that contain .spec. |
| 22 | 'src/tests.webpack.js' |
| 23 | ], |
| 24 | |
| 25 | preprocessors: { |
| 26 | // Reference: http://webpack.github.io/docs/testing.html |
| 27 | // Reference: https://github.com/webpack/karma-webpack |
| 28 | // Convert files with webpack and load sourcemaps |
| 29 | 'src/tests.webpack.js': ['webpack', 'sourcemap'] |
| 30 | }, |
| 31 | |
| 32 | browsers: [ |
| 33 | // Run tests using PhantomJS |
| 34 | 'PhantomJS' |
| 35 | ], |
| 36 | |
| 37 | singleRun: true, |
| 38 | |
| 39 | // Configure code coverage reporter |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 40 | coverageReporter: |
| 41 | {dir: 'coverage/', reporters: [{type: 'text-summary'}, {type: 'html'}]}, |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 42 | |
| 43 | webpack: require('./webpack.config'), |
| 44 | |
| 45 | // Hide webpack build information from output |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 46 | webpackMiddleware: {noInfo: 'errors-only'} |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 47 | }); |
| 48 | }; |