-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
86 lines (82 loc) · 1.79 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
const merge = require('lodash/merge');
const webpack = require('webpack');
const webpackCfg = require('./webpack.config');
const useIframe = process.argv.includes('--iframe');
const completed = process.argv.includes('--completed');
module.exports = function(config) {
const customLaunchers = !completed ? {} : {
// Chrome on Windows
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
version: '49.0',
platform: 'Windows 10',
},
};
const browsers =
!completed ? ['SlimerJS'] : Object.keys(customLaunchers);
config.set({
basePath: '',
browsers,
customLaunchers,
files: [
'test/runner.js',
// Use bluebird as Promise polyfill
'node_modules/bluebird/js/browser/bluebird.js',
// Dom 4 polyfill
'node_modules/dom4/build/dom4.js',
],
port: 8080,
captureTimeout: 120000,
frameworks: [
'mocha',
'chai-dom',
'chai',
'sinon-chai',
'sinon',
],
client: {
useIframe,
mocha: {},
chai: {
includeStack: true,
},
},
singleRun: true,
reporters: !completed ? [
'mocha',
'coverage',
] : [
'mocha',
'saucelabs',
],
preprocessors: {
'test/runner.js': [
'webpack',
],
},
concurrency: 5,
webpack: merge(webpackCfg, {
plugins: [
new webpack.DefinePlugin({
"process.env": {
SLIMER: !completed ? JSON.stringify(true) : JSON.stringify(false)
}
}),
],
}),
webpackServer: {
noInfo: true,
},
sauceLabs: !completed ? {} : {
testName: 'Verpix Viewer Testing',
},
coverageReporter: {
dir: 'coverage/',
reporters: [
{ type: 'html' },
{ type: 'text' },
],
},
});
};