forked from mozilla/activity-stream
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
97 lines (95 loc) · 3.04 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
const webpack = require("./webpack.config");
const path = require("path");
const reporters = ["mocha", "coverage"];
if (process.env.TRAVIS) {
reporters.push("coveralls");
}
module.exports = function(config) {
config.set({
singleRun: true,
browsers: ["Firefox"],
frameworks: ["mocha", "sinon", "chai"],
reporters,
coverageReporter: {
dir: "logs/reports/coverage",
reporters: [
{
type: "lcov",
subdir: "lcov"
},
{
type: "html",
subdir: "html"
},
{
type: "text",
subdir: ".",
file: "text.txt"
},
{
type: "text-summary",
subdir: ".",
file: "text-summary.txt"
}
]
},
files: [
"content-test/index.js",
{pattern: "data/content/favicons/**/*", watched: false, included: false, served: true}
],
proxies: {"/favicons/": "/base/data/content/favicons/"},
preprocessors: {"content-test/**/*.js": ["webpack", "sourcemap"]},
webpack: {
devtool: "inline-source-map",
externals: { // enzyme currently needs this
"react/addons": true,
"react/lib/ExecutionEnvironment": true,
"react/lib/ReactContext": true
},
resolve: {
extensions: webpack.resolve.extensions,
alias: Object.assign({}, webpack.resolve.alias, {
"shims": path.join(__dirname, "shims"),
// This is necessary in order to be able to import
// files from the addon side.
"chrome": "shims/chrome.js",
"sdk": "shims/sdk"
})
},
resolveLoader: {alias: {inject: path.join(__dirname, "loaders/inject-loader")}},
module: {
rules: webpack.module.rules.concat([
{
enforce: "post",
test: /\.js$/,
loader: "istanbul-instrumenter-loader",
include: [
path.join(__dirname, "content-src"),
path.join(__dirname, "common"),
path.join(__dirname, "addon")
],
exclude: [
/DebugPage/,
/\.test\.js$/,
path.join(__dirname, "addon/ActivityStreams.js"),
path.join(__dirname, "addon/AppURLHider.js"),
path.join(__dirname, "addon/ColorAnalyzer.js"),
path.join(__dirname, "addon/ColorAnalyzerProvider.js"),
path.join(__dirname, "addon/main.js"),
path.join(__dirname, "addon/MetadataStore.js"),
path.join(__dirname, "addon/MetadataStoreMigration.js"),
path.join(__dirname, "addon/PlacesProvider.js"),
path.join(__dirname, "addon/PreviewProvider.js"),
path.join(__dirname, "addon/SearchProvider.js"),
path.join(__dirname, "addon/TabTracker.js"),
path.join(__dirname, "addon/TelemetrySender.js"),
path.join(__dirname, "addon/TippyTopProvider.js")
]
}
])
},
plugins: webpack.plugins
},
webpackMiddleware: {noInfo: true}
});
};