-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
45 lines (42 loc) · 1.79 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
process.env.NODE_ENV = "development";
var path = require("path");
var webpackConfig = require(path.resolve("webpack.config.js"));
webpackConfig.module.loaders.push({
test: /\.spec\.js$/,
include: path.join(__dirname, "test"),
loader: "babel-loader!imports-loader?test_bootstrap=test/test_bootstrap.js"
});
webpackConfig.devtool = "inline-source-map";
module.exports = function (config) {
config.set({
browsers: ((process.platform == "darwin") ? ["Firefox", "Chrome", "Safari"]
: ["Firefox", "Chrome"]),
frameworks: [ "mocha" ], //use the mocha test framework
files: [ //just load these files
"test/test_bundle.js", "dist/main.css",
{pattern: "src/img/**/*.svg", watched: false, included: false, served: true, nocache: false},
{pattern: "dist/*", watched: false, included: false, served: true, nocache: false},
{pattern: "test/img/*", watched: false, included: false, served: true, nocache: false}
],
preprocessors: {
"test/test_bundle.js": [ "webpack", "sourcemap" ] //preprocess with webpack and our sourcemap loader
},
proxies: {
"/src/img/": "http://localhost:9876/base/src/img/",
"/dist/": "http://localhost:9876/base/dist/",
"/test/img/": "http://localhost:9876/base/test/img/"
},
reporters: [ "dots" ], //report results in this format
webpack: webpackConfig,
webpackServer: {
noInfo: true //please don"t spam the console when running in karma!
},
logLevel: config.LOG_DEBUG,
// Timeout for capturing a browser (in ms).
captureTimeout: 180 * 1e3,
// to avoid DISCONNECTED messages
browserDisconnectTimeout : 10000, // default 2000
browserDisconnectTolerance : 1, // default 0
browserNoActivityTimeout : 60 * 1e3, //default 10000
});
};