-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
80 lines (69 loc) · 2.11 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
/*global module, process*/
'use strict';
module.exports = function(config) {
config.set({
files: [
//polyfill like we do with chorme browsers
// Grab all files in the app folder that contain .test.
'node_modules/babel-polyfill/dist/polyfill.js',
'test/*.test.js'
],
frameworks: [
'jasmine'
],
plugins: [
'karma-jasmine',
'karma-webpack',
'karma-sourcemap-loader',
'karma-phantomjs-launcher',
'karma-spec-reporter',
'karma-chrome-launcher'
],
reporters: [
// Reference: https://github.com/mlex/karma-spec-reporter
// Set reporter to print detailed results to console
'spec'
],
preprocessors: {
// Reference: http://webpack.github.io/docs/testing.html
// Reference: https://github.com/webpack/karma-webpack
// Convert files with webpack and load sourcemaps
'test/*.test.js': ['webpack', 'sourcemap']
},
browsers: [
// Run tests using PhantomJS
'PhantomJS'
],
singleRun: true,
webpack: {
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
loader: 'babel-loader?plugins=rewire'
},
{
// sass-loader for the origami pieces
test: /\.scss$/,
loader: 'null-loader'
},
{
test: /\.json$/,
loader: 'json'
},
]
},
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js']
},
plugins: [
]
},
// Hide webpack build information from output
webpackMiddleware: {
noInfo: true
}
});
};