-
Notifications
You must be signed in to change notification settings - Fork 107
/
karma.conf.js
115 lines (109 loc) · 2.25 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
'use strict';
const path = require('path');
const stdLibBrowser = require('node-stdlib-browser');
let config;
const isCI =
typeof process.env.CI !== 'undefined' && process.env.CI !== 'false';
const local =
!isCI ||
(isCI && typeof process.env.BROWSER_STACK_ACCESS_KEY === 'undefined');
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',
'project': 'throttle-debounce',
'build': 'Automated (Karma)',
'browser': 'Chrome',
'browser_version': '72',
'name': 'Chrome',
'os': 'Windows',
'os_version': '7'
},
'BS-Edge': {
'base': 'BrowserStack',
'project': 'throttle-debounce',
'build': 'Automated (Karma)',
'browser': 'Edge',
'browser_version': '15',
'name': 'Edge',
'os': 'Windows',
'os_version': '10'
},
'BS-Firefox': {
'base': 'BrowserStack',
'project': 'throttle-debounce',
'build': 'Automated (Karma)',
'browser': 'Firefox',
'browser_version': '65',
'name': 'Firefox',
'os': 'Windows',
'os_version': '7'
}
},
browsers: ['BS-Chrome', 'BS-Edge', 'BS-Firefox']
};
}
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: 'inline-source-map',
resolve: {
fallback: {
assert: stdLibBrowser.assert
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
}
]
}
]
}
},
singleRun: true,
concurrency: Infinity,
...config
});
};