blob: 37075786af437e797c3cecfc5a5cdc210452e864 [file] [log] [blame]
Ed Tanousbbcf6702017-10-06 13:53:06 -07001// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07002module.exports = function karmaConfig(config) {
Ed Tanousbbcf6702017-10-06 13:53:06 -07003 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
40 coverageReporter: {
41 dir: 'coverage/',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070042 reporters: [{
43 type: 'text-summary'
44 },
45 {
46 type: 'html'
47 }
Ed Tanousbbcf6702017-10-06 13:53:06 -070048 ]
49 },
50
51 webpack: require('./webpack.config'),
52
53 // Hide webpack build information from output
54 webpackMiddleware: {
55 noInfo: 'errors-only'
56 }
57 });
58};