-
Notifications
You must be signed in to change notification settings - Fork 329
/
karma.conf.js
113 lines (101 loc) · 2.7 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
// load .env so we can use it for browserstack
require("dotenv").config();
module.exports = function(config) {
config.set({
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["mocha"],
// files to watch
files: ["tests/*-test.js", "dist/dropkick.css"],
// processors per file
preprocessors: {
"tests/*-test.js": ["webpack"]
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "BrowserStack"],
browserStack: {
username: process.env.BROWSER_STACK_USERNAME,
accessKey: process.env.BROWSER_STACK_ACCESS_KEY
},
// define browsers
customLaunchers: {
windows7_chrome50: {
base: "BrowserStack",
os: "Windows",
os_version: "7",
browser: "chrome",
device: null,
browser_version: "50.0"
},
windows7_ff50: {
base: "BrowserStack",
os: "Windows",
os_version: "7",
browser: "firefox",
device: null,
browser_version: "50.0"
},
windows7_ie11: {
base: "BrowserStack",
os: "Windows",
os_version: "7",
browser: "ie",
device: null,
browser_version: "11"
},
osxMav_chrome50: {
base: "BrowserStack",
os: "OS X",
os_version: "Mavericks",
browser: "chrome",
device: null,
browser_version: "50.0"
},
osxMav_ff50: {
base: "BrowserStack",
os: "OS X",
os_version: "Mavericks",
browser: "firefox",
device: null,
browser_version: "50.0"
},
Chrome_travis_ci: {
base: "Chrome",
flags: ["--no-sandbox"]
}
},
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ["Chrome"],
// webpack configuration
webpack: require("./webpack.config.js"),
// webpack-dev-middleware config
webpackMiddleware: {
stats: "errors-only"
},
// enable our plugins
plugins: [
require("karma-mocha"),
require("karma-webpack"),
require("karma-mocha-reporter"),
require("karma-browserstack-launcher"),
require("karma-chrome-launcher")
]
});
// CI config
if (process.env.TRAVIS || process.env.CI) {
config.singleRun = true;
config.browsers = ["Chrome_travis_ci", "windows7_ff50"];
}
if (process.env.BROWSER_STACK) {
config.browsers.push(
"windows7_ie11",
"windows7_chrome50",
"windows7_ff50",
"osxMav_chrome50",
"osxMav_ff50"
);
}
};