forked from hybridsjs/hybrids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
135 lines (130 loc) · 3.2 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
// eslint-disable-next-line import/no-extraneous-dependencies
const webpack = require("webpack");
const webpackConfig = require("./webpack.config");
const IS_COVERAGE = process.env.NODE_ENV === "coverage";
const IS_SAUCE_LABS =
!IS_COVERAGE &&
!!process.env.TRAVIS &&
process.env.TRAVIS_BRANCH === "master" &&
process.env.TRAVIS_PULL_REQUEST === "false";
const customLaunchers = {
SL_Chrome: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 10",
version: "latest",
},
SL_Chrome_1: {
base: "SauceLabs",
browserName: "chrome",
platform: "Windows 10",
version: "latest-1",
},
SL_Firefox: {
base: "SauceLabs",
browserName: "firefox",
platform: "Windows 10",
version: "latest",
},
SL_Firefox_1: {
base: "SauceLabs",
browserName: "firefox",
platform: "Windows 10",
version: "latest-1",
},
SL_Safari: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.13",
version: "latest",
},
SL_Safari_1: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.13",
version: "latest-1",
},
SL_IE_11: {
base: "SauceLabs",
browserName: "internet explorer",
platform: "Windows 8.1",
version: "11",
},
SL_EDGE: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest",
},
SL_EDGE_1: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest-1",
},
SL_iOS: {
base: "SauceLabs",
browserName: "iphone",
platform: "macOS 10.13",
version: "latest",
},
SL_iOS_1: {
base: "SauceLabs",
browserName: "iphone",
platform: "macOS 10.13",
version: "latest-1",
},
};
const reporters = ["dots"];
if (IS_COVERAGE) reporters.push("coverage");
if (IS_SAUCE_LABS) reporters.push("saucelabs");
module.exports = config => {
config.set({
frameworks: ["jasmine"],
reporters,
browsers: IS_SAUCE_LABS ? Object.keys(customLaunchers) : ["ChromeHeadless"],
files: [
"node_modules/core-js/es/weak-map/index.js",
"node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
"test/runner.js",
],
preprocessors: {
"node_modules/core-js/**/*": ["webpack"],
"test/runner.js": ["webpack", "sourcemap"],
},
webpack: {
module: {
...webpackConfig.module,
},
devtool: false, // "inline-source-map",
mode: "development",
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": "env",
}),
],
},
webpackMiddleware: {
noInfo: true,
stats: "errors-only",
},
coverageReporter: {
dir: "coverage/",
reporters: [
{ type: "html", subdir: "report-html" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
],
},
captureTimeout: 120000,
browserNoActivityTimeout: 300000,
browserDisconnectTolerance: 2,
customLaunchers,
sauceLabs: {
testName: "Hybrids Unit Tests",
build: `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
},
autoWatch: true,
singleRun: false,
});
};