-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
162 lines (138 loc) · 3.76 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
'use strict';
var path = require('path');
var webpack = require('webpack');
module.exports = function(config) {
config.set({
plugins: [
'karma-webpack',
'karma-jasmine',
'karma-coverage',
'istanbul-instrumenter-loader',
'karma-htmlfile-reporter',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-firefox-launcher',
'karma-coveralls'
],
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
preprocessors: {
'src/**/*.js': ['webpack']
},
reporters: ['progress', 'coverage', 'html', 'coveralls'],
// list of files / patterns to load in the browser
files: [
'node_modules/phaser/dist/phaser-arcade-physics.js',
'node_modules/phaser-debug/dist/phaser-debug.js',
//'../cirsa_builds/libs/phasersito.vendor.js',
'src/**/*.spec.js'
],
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies
// webpack configuration
cache: false,
//entry: entries,
context: path.join(__dirname, 'src'),
module: {
loaders: [{
test: /\.js$/i,
exclude: /node_modules/i,
loader: 'traceur?experimental&arrayComprehension&runtime'
}, {
test: /(phaser-arcade-physics|phaser-debug)\.js$/i,
loader: 'script'
}, {
test: /\.json$/i,
exclude: /\.audiosprite\.json$/i,
loader: 'json'
}, {
test: /\.css$/i,
loader: 'style!css'
}, {
test: /\.less$/i,
loader: 'style!css!less'
}, {
test: /\.(jpe?g|png|gif)$/i,
loader: 'image?bypassOnDebug&name=[path][name].[ext]?[hash]'
}, {
test: /\.(mp3|ac3|ogg|m4a)$/i,
loader: 'file?name=[path][name].[ext]?[hash]'
}, {
test: /\.(ttf|woff|eot)$/i,
loader: 'file?name=[path][name].[ext]?[hash]'
}, {
test: /\.audiosprite\.json$/i,
loader: 'file?name=[path][name].[ext]?[hash]'
}],
postLoaders: [{ // << add subject as webpack's postloader
test: /\.js$/,
loader: 'istanbul-instrumenter'
}]
},
node: {
console: true
},
resolve: {
alias: {
// Console polyfill for IE9
'consolePolyfill': path.join(__dirname, 'vendor/consolePolyfill.js'),
'phaserito': path.join(__dirname, 'src/lib/main.js'),
'phaser': path.join(__dirname, 'node_modules/phaser/dist/phaser-arcade-physics.js'),
'phaser-debug': path.join(__dirname, 'node_modules/phaser-debug/dist/phaser-debug.js')
},
extensions: ['', '.js', '.mustache']
},
plugins: [
new webpack.ProvidePlugin({
Promise: 'bluebird',
phaserito: 'phaserito',
Phaserito: 'phaserito'
})
]
},
webpackServer: {
// webpack-dev-server configuration
// webpack-dev-middleware configuration
// debug mode off.
noInfo: true,
stats: {
colors: true
}
},
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
// optionally, configure the reporter
coverageReporter: {
type: 'html',
dir: 'reports/coverage'
},
htmlReporter: {
outputFile: 'reports/tests/units.html'
}
});
};