forked from openmrs/openmrs-module-coreapps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
48 lines (44 loc) · 1.26 KB
/
karma.conf.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
41
42
43
44
45
46
47
48
module.exports = function(config) {
var pkg = require("./package.json");
var webpackConfig = require('./webpack.config');
webpackConfig.devtool = 'inline-source-map';
//Disable CommonsChunkPlugin as it breaks tests.
var commonsChunkPluginIndex = webpackConfig.plugins.findIndex(function(plugin) { return plugin.chunkNames });
webpackConfig.plugins.splice(commonsChunkPluginIndex, 1);
var karmaConfig = {
browsers: ['PhantomJS'],
customLaunchers: {
ChromeWithoutSecurity: {
base: 'Chrome',
flags: ['--disable-web-security']
},
FirefoxNoSandbox: {
base: 'Firefox',
flags: ['--no-sandbox']
}
},
files: [
{ pattern: 'node_modules/babel-polyfill/browser.js', instrument: false},
{ pattern: pkg.config.sourceDir + '/karma.context.js' }
],
frameworks: ['jasmine'],
preprocessors: {
'**/karma.context.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: "errors-only"
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
concurrency: Infinity,
singleRun: true
};
if (process.env.TRAVIS) {
karmaConfig.browsers = ['FirefoxNoSandbox'];
}
config.set(karmaConfig);
};