forked from Semantic-Org/Semantic-UI-React
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.babel.js
72 lines (71 loc) · 1.81 KB
/
karma.conf.babel.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import paths from './paths'
import statConfig from './webpack-stats'
import exitPlugin from './webpack-exit-plugin'
import ENV from './ENV'
/**
* This config is for running tests on the command line and will fail on errors.
* @param {{}} config Karma config object.
* @type {{}}
*/
export default (config) => {
config.set({
browsers: ['PhantomJS'],
singleRun: !ENV.isDevelopment(),
reporters: [ENV.isDevelopment() ? 'mocha' : 'dots'],
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'./test/tests.bundle.js',
],
frameworks: [
'mocha',
],
preprocessors: {
'**/*.bundle.js': ['webpack', 'sourcemap'],
},
client: {
mocha: {
// require: '',
reporter: 'html', // change Karma's debug.html to mocha web reporter
ui: 'bdd',
},
},
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies
devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel', 'eslint'],
exclude: paths.node_modules,
},
{
test: /\.json$/,
loaders: ['json'],
exclude: paths.node_modules,
},
],
},
resolve: {
root: paths.root,
alias: {
// When these key names are require()'d, the value will be supplied instead
jquery: paths.testMocks + '/SemanticjQuery-mock.js',
stardust: paths.src + '/index.js',
},
},
plugins: !ENV.isDevelopment()
? [exitPlugin]
: [],
},
webpackServer: {
progress: false,
stats: statConfig,
debug: true,
noInfo: false,
quiet: false,
},
})
}