-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
154 lines (148 loc) · 3.88 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
/* global module require */
/* eslint-env node */
"use strict";
var _ = require("lodash");
// Minimal localConfig if there is not one locally.
var localConfig = {
browserStack: {},
};
try {
// eslint-disable-next-line import/no-unresolved, global-require
localConfig = require("./localConfig");
}
catch (ex) {} // eslint-disable-line no-empty
module.exports = function configure(config) {
var options = {
basePath: "",
frameworks: ["requirejs", "mocha"],
files: [
"test/karma-main.js",
{ pattern: "index.js", included: false },
{ pattern: "test/**/!(commonjs).js", included: false },
{ pattern: "node_modules/bluejax.try/dist/bluejax.try.*",
included: false },
{ pattern: "node_modules/jquery/dist/jquery.js", included: false },
{ pattern: "node_modules/bluebird/js/browser/bluebird.js",
included: false },
{ pattern: "node_modules/chai/chai.js", included: false },
{ pattern: "node_modules/chai-as-promised/lib/chai-as-promised.js", included: false },
{ pattern: "node_modules/sinon/lib/**/*.js", included: false },
],
exclude: [
],
client: {
mocha: {
asyncOnly: true,
},
},
preprocessors: {
"test/**/!(karma-main).js": ["babelModule"],
"test/karma-main.js": ["babel"],
"index.js": ["coverage"],
},
customPreprocessors: {
babelModule: {
base: "babel",
options: {
plugins: ["transform-es2015-modules-amd"],
},
},
},
babelPreprocessor: {
options: {
presets: ["es2015"],
sourceMap: "inline",
},
filename: function filename(file) {
return file.originalPath.replace(/\.js$/, ".es5.js");
},
sourceFileName: function sourceFileName(file) {
return file.originalPath;
},
},
reporters: ["progress", "coverage"],
coverageReporter: {
dir: "coverage/karma",
reporters: [
{ type: "html" },
{ type: "json" },
],
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ["Chrome", "Firefox"],
browserStack: {
project: "bluejax",
},
customLaunchers: {
ChromeWin: {
base: "BrowserStack",
browser: "Chrome",
os: "Windows",
os_version: "10",
},
FirefoxWin: {
base: "BrowserStack",
browser: "Firefox",
os: "Windows",
os_version: "10",
},
IE11: {
base: "BrowserStack",
browser: "IE",
browser_version: "11",
os: "Windows",
os_version: "10",
},
IE10: {
base: "BrowserStack",
browser: "IE",
browser_version: "10",
os: "Windows",
os_version: "8",
},
Edge: {
base: "BrowserStack",
browser: "Edge",
os: "Windows",
os_version: "10",
},
Opera: {
base: "BrowserStack",
browser: "Opera",
os: "Windows",
os_version: "10",
},
SafariElCapitan: {
base: "BrowserStack",
browser: "Safari",
os: "OS X",
os_version: "El Capitan",
},
SafariYosemite: {
base: "BrowserStack",
browser: "Safari",
os: "OS X",
os_version: "Yosemite",
},
SafariMavericks: {
base: "BrowserStack",
browser: "Safari",
os: "OS X",
os_version: "Mavericks",
},
},
singleRun: false,
};
// Bring in the options from the localConfig file.
_.merge(options.browserStack, localConfig.browserStack);
var browsers = config.browsers;
if (browsers.length === 1 && browsers[0] === "all") {
var newList = options.browsers.concat(Object.keys(options.customLaunchers));
// Yes, we must modify this array in place.
browsers.splice.apply(browsers, [0, browsers.length].concat(newList));
}
config.set(options);
};