forked from pixeleet/react-cookie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
77 lines (73 loc) · 1.81 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
const webpack = require('webpack');
module.exports = config => {
config.set({
browsers: ['Chrome'],
frameworks: ['jasmine'],
reporters: ['spec', 'kjhtml'],
files: ['tests.webpack.js'],
preprocessors: {
'tests.webpack.js': ['webpack', 'sourcemap']
},
webpack: {
mode: 'development',
devtool: 'inline-source-map',
module: {
rules: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader' },
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'awesome-typescript-loader'
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('test')
})
]
},
webpackServer: {
noInfo: true
}
});
if (process.env.TRAVIS) {
const customLaunchers = {
SL_Chrome_latest: {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest',
platform: 'Linux'
},
SL_Firefox_latest: {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest',
platform: 'Windows 10'
},
SL_Edge_Latest: {
base: 'SauceLabs',
browserName: 'microsoftedge',
version: 'latest',
platform: 'Windows 10'
},
SL_Safari_10: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11',
version: '10.0'
}
};
config.sauceLabs = {
testName: 'Cookies Unit Tests',
build: process.env.TRAVIS_BUILD_NUMBER
};
config.singleRun = true;
config.customLaunchers = customLaunchers;
config.browsers = Object.keys(customLaunchers);
config.reporters = ['spec', 'saucelabs'];
}
};