-
Notifications
You must be signed in to change notification settings - Fork 107
/
karma.conf.js
108 lines (102 loc) · 2.09 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
'use strict';
const path = require('path');
let config;
const isCI =
typeof process.env.CI !== 'undefined' && process.env.CI !== 'false';
const isPR =
typeof process.env.TRAVIS_PULL_REQUEST !== 'undefined' &&
process.env.TRAVIS_PULL_REQUEST !== 'false';
const local = !isCI || (isCI && isPR);
const port = 0;
if (local) {
config = {
browsers: ['Chrome']
};
} else {
config = {
hostname: 'bs-local.com',
browserStack: {
username: process.env.BROWSER_STACK_USERNAME,
accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
startTunnel: true,
project: 'throttle-debounce',
name: 'Automated (Karma)',
build: 'Automated (Karma)'
},
customLaunchers: {
'BS-Chrome': {
base: 'BrowserStack',
browser: 'Chrome',
os: 'Windows',
'os_version': '7',
project: 'throttle-debounce',
build: 'Automated (Karma)',
name: 'Chrome'
},
'BS-Firefox': {
base: 'BrowserStack',
browser: 'Firefox',
os: 'Windows',
'os_version': '7',
project: 'throttle-debounce',
build: 'Automated (Karma)',
name: 'Firefox'
},
'BS-IE9': {
base: 'BrowserStack',
browser: 'IE',
'browser_version': '9',
os: 'Windows',
'os_version': '7',
project: 'throttle-debounce',
build: 'Automated (Karma)',
name: 'IE9'
}
},
browsers: ['BS-Chrome', 'BS-Firefox', 'BS-IE9']
};
}
module.exports = function (baseConfig) {
baseConfig.set({
basePath: '',
frameworks: ['qunit'],
files: ['test/**/.webpack.js'],
exclude: [],
preprocessors: {
'test/**/.webpack.js': ['webpack', 'sourcemap']
},
reporters: ['mocha'],
port: port,
colors: true,
logLevel: baseConfig.LOG_INFO,
autoWatch: false,
client: {
captureConsole: true
},
browserConsoleLogOptions: {
level: 'log',
format: '%b %T: %m',
terminal: true
},
webpack: {
mode: 'none',
devtool: 'cheap-module-inline-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
}
]
}
]
}
},
singleRun: true,
concurrency: Infinity,
...config
});
};