forked from mschlitz-trux/angularjs-webpack-babel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.config.js
40 lines (32 loc) · 1.15 KB
/
karma.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const webpackConfig = require('./config/webpack.test.js')();
module.exports = config => {
config.set({
basePath: '',
// frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'webpack'],
// This will be the new entry to webpack so it should just be a single file
files: ['src/main.js', 'src/index.tests.js'],
// Preprocess test index and test files using webpack (will run babel)
preprocessors: {
'src/main.js': ['webpack'],
'src/index.tests.js': ['webpack'],
},
// Reference webpack config (single object)
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// test results reporter to use
// possible values: 'dots', 'progress'
// https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO, // possible values: LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG
autoWatch: true, // if true, Karma captures browsers, runs the tests and exits
browsers: ['ChromeHeadless'],
singleRun: false,
concurrency: Infinity,
});
};