This repository was archived by the owner on Sep 25, 2025. It is now read-only.
forked from buildit/aem-react-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.prod.js
More file actions
89 lines (82 loc) · 2.68 KB
/
karma.conf.prod.js
File metadata and controls
89 lines (82 loc) · 2.68 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
var path = require('path')
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai', 'sinon'],
files: [
'src/**/*.spec.js'
],
preprocessors: {
'src/**/*.spec.js': ['webpack', 'sourcemap'],
'src/**/*.jsx': ['webpack', 'sourcemap', 'coverage']
},
webpack: {
devtool: 'inline-source-map',
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
resolve: {
root: __dirname,
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx'],
modulesDirectories: [
path.join(__dirname, 'node_modules'),
path.join(__dirname, 'aem')
]
},
module: {
loaders: [
{ test: /\.(js|jsx)$/, exclude: [ /node_modules/, /vendor/ ], loader: 'babel' },
{ test: /\.(css)$/, loader: 'style-loader!css-loader!postcss-loader' },
{ test: /\.(png|jpg|gif)$/, loader: 'ignore-loader' },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'ignore-loader' },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'ignore-loader' },
],
postLoaders: [
{ test: /\.(jsx)$/, exclude: [ /test/, /node_modules/, /vendor/ ], loader: 'istanbul-instrumenter' },
]
},
externals: {
'cheerio': 'window',
'sinon': true,
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
},
junitReporter: {
outputDir: 'src/target/test-reports',
outputFile: 'test-report.xml',
suite: '', // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},
coverageReporter: {
type: 'cobertura',
dir: 'src/target/test-reports',
subdir: '.'
},
webpackServer: {
noInfo: true,
stats: 'errors-only'
},
plugins: [
'karma-webpack',
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-sourcemap-loader',
'karma-phantomjs-launcher',
'karma-junit-reporter',
'karma-coverage',
],
reporters: ['junit', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: true,
})
}