-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
71 lines (66 loc) · 1.69 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
const babel = require('rollup-plugin-babel')
// TODO: move to separate file
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 7',
version: '35'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '30'
},
// sl_ios_safari: {
// base: 'SauceLabs',
// browserName: 'iphone',
// platform: 'OS X 10.9',
// version: '7.1'
// },
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
}
}
module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['qunit'],
plugins: ['karma-qunit', 'karma-babel-preprocessor', 'karma-rollup-preprocessor', 'karma-sauce-launcher'],
files: [
// freiform.js is watched to trigger the preprocessor on demand
{ pattern: './freiform.js', included: true, watched: true },
// test infrastructure
{ pattern: 'node_modules/sinon/pkg/sinon.js', included: true, watched: false },
// tests
{ pattern: 'test/**/*.js', watched: true }
],
preprocessors: {
'freiform.js': ['rollup'],
'test/**/*.js': ['babel']
},
rollupPreprocessor: {
entry: 'freiform.js',
format: 'iife',
moduleName: 'freiform',
plugins: [ babel() ]
},
babelPreprocessor: {
options: {
presets: ['es2015']
}
},
sauceLabs: {
testName: 'Freiform Library Tests',
startConnect: false,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
},
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
reporters: ['dots', 'saucelabs'],
singleRun: true
})
}