|
1 | 1 | // Karma configuration |
2 | 2 | // Generated on Wed Jul 20 2016 12:00:09 GMT-0400 (EDT) |
| 3 | +'use strict'; |
3 | 4 | const webpackConf = require('./webpack.config.js'); |
4 | 5 | const webpack = require('webpack'); |
5 | 6 |
|
6 | 7 | module.exports = function karmaCfg(config){ |
7 | | - config.set({ |
8 | | - // base path that will be used to resolve all patterns (eg. files, exclude) |
9 | | - basePath: '', |
| 8 | + config.set({ |
| 9 | + // base path that will be used to resolve all patterns (eg. files, exclude) |
| 10 | + basePath: '', |
10 | 11 |
|
11 | | - // frameworks to use |
12 | | - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
13 | | - frameworks: ['webpack', 'mocha', 'chai'], |
| 12 | + // frameworks to use |
| 13 | + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 14 | + frameworks: ['webpack', 'mocha', 'chai'], |
14 | 15 |
|
15 | | - // list of files / patterns to load in the browser |
16 | | - files: [ |
17 | | - 'dist/particle.min.js', |
18 | | - 'test/*.spec.js', |
19 | | - 'test/*.integration.js' |
20 | | - ], |
| 16 | + // list of files / patterns to load in the browser |
| 17 | + files: [ |
| 18 | + 'dist/particle.min.js', |
| 19 | + 'test/*.spec.js', |
| 20 | + 'test/*.integration.js' |
| 21 | + ], |
21 | 22 |
|
22 | | - // list of files to exclude |
23 | | - exclude: [ |
24 | | - ], |
| 23 | + // list of files to exclude |
| 24 | + exclude: [ |
| 25 | + ], |
25 | 26 |
|
26 | | - // preprocess matching files before serving them to the browser |
27 | | - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
28 | | - preprocessors: { |
29 | | - 'src/**/*.js': ['webpack'], |
30 | | - 'test/**/*.js': ['webpack'] |
31 | | - }, |
| 27 | + // preprocess matching files before serving them to the browser |
| 28 | + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 29 | + preprocessors: { |
| 30 | + 'src/**/*.js': ['webpack'], |
| 31 | + 'test/**/*.js': ['webpack'] |
| 32 | + }, |
32 | 33 |
|
33 | | - // Transform test files to a single browser consumable file |
34 | | - webpack: { |
35 | | - mode: 'development', |
36 | | - target: 'web', |
37 | | - devtool: 'inline-source-map', |
38 | | - output: webpackConf.output, |
39 | | - externals: webpackConf.externals, |
40 | | - resolve: webpackConf.resolve, |
41 | | - plugins: [ |
42 | | - new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), |
43 | | - new webpack.EnvironmentPlugin({ |
44 | | - SKIP_AGENT_TEST: process.env.SKIP_AGENT_TEST || false |
45 | | - }) |
46 | | - ] |
47 | | - }, |
| 34 | + // Transform test files to a single browser consumable file |
| 35 | + webpack: { |
| 36 | + mode: 'development', |
| 37 | + target: 'web', |
| 38 | + devtool: 'inline-source-map', |
| 39 | + output: webpackConf.output, |
| 40 | + externals: webpackConf.externals, |
| 41 | + resolve: webpackConf.resolve, |
| 42 | + plugins: [ |
| 43 | + new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), |
| 44 | + new webpack.EnvironmentPlugin({ |
| 45 | + SKIP_AGENT_TEST: process.env.SKIP_AGENT_TEST || false |
| 46 | + }) |
| 47 | + ] |
| 48 | + }, |
48 | 49 |
|
49 | | - // test results reporter to use |
50 | | - // possible values: 'dots', 'progress' |
51 | | - // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
52 | | - reporters: ['progress', 'coverage'], |
| 50 | + // test results reporter to use |
| 51 | + // possible values: 'dots', 'progress' |
| 52 | + // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
| 53 | + reporters: ['progress', 'coverage'], |
53 | 54 |
|
54 | | - // web server port |
55 | | - port: 9876, |
| 55 | + // web server port |
| 56 | + port: 9876, |
56 | 57 |
|
57 | | - // enable / disable colors in the output (reporters and logs) |
58 | | - colors: true, |
| 58 | + // enable / disable colors in the output (reporters and logs) |
| 59 | + colors: true, |
59 | 60 |
|
60 | | - // level of logging |
61 | | - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
62 | | - logLevel: config.LOG_INFO, |
| 61 | + // level of logging |
| 62 | + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 63 | + logLevel: config.LOG_INFO, |
63 | 64 |
|
64 | | - // enable / disable watching file and executing tests whenever any file changes |
65 | | - autoWatch: true, |
| 65 | + // enable / disable watching file and executing tests whenever any file changes |
| 66 | + autoWatch: true, |
66 | 67 |
|
67 | | - // start these browsers |
68 | | - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
69 | | - browsers: ['Firefox'], |
| 68 | + // start these browsers |
| 69 | + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
| 70 | + browsers: ['Firefox'], |
70 | 71 |
|
71 | | - // Continuous Integration mode |
72 | | - // if true, Karma captures browsers, runs the tests and exits |
73 | | - singleRun: false, |
| 72 | + // Continuous Integration mode |
| 73 | + // if true, Karma captures browsers, runs the tests and exits |
| 74 | + singleRun: false, |
74 | 75 |
|
75 | | - // Concurrency level |
76 | | - // how many browser should be started simultaneous |
77 | | - concurrency: Infinity |
78 | | - }); |
| 76 | + // Concurrency level |
| 77 | + // how many browser should be started simultaneous |
| 78 | + concurrency: Infinity |
| 79 | + }); |
79 | 80 | }; |
0 commit comments