-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma.conf.js
71 lines (71 loc) · 1.62 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
module.exports = function (config) {
let cfg = {
basePath: '.',
frameworks: ['mocha', 'chai'],
browsers: ['ChromeDebugging'],
reporters: ['mocha', 'coverage'],
files: [
'test/**/*.spec.js',
// Watch src files for changes but
// don't load them into the browser.
{ pattern: 'src/**/*.js', included: false }
],
coverageReporter: {
reporters: [
{ type: 'lcovonly', subdir: '.' },
{ type: 'json', subdir: '.' },
]
},
rollupPreprocessor: {
plugins: [
require('rollup-plugin-buble')(),
],
format: 'iife',
moduleName: 'test', //<your_project>
sourceMap: 'inline',
},
customPreprocessors: {
// Clones the base preprocessor, but overwrites
// its options with those defined below.
rollupBabel: {
base: 'rollup',
options: {
// In this case, to use
// a different transpiler:
plugins: [
require('rollup-plugin-node-resolve')(),
require('rollup-plugin-babel')(),
],
}
}
}
}
if (process.env.TRAVIS) {
cfg.browsers = ['Chrome_travis_ci'];
cfg.preprocessors = {
'src/**/*.js': ['rollupBabel', 'coverage'],
'test/**/*.spec.js': ['rollupBabel', 'coverage']
};
cfg.customLaunchers = {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
} else {
cfg.browserDisconnectTimeout = 30000;
cfg.browserNoActivityTimeout = 30000;
cfg.processKillTimeout = 30000;
cfg.preprocessors = {
'src/**/*.js': ['rollupBabel'],
'test/**/*.spec.js': ['rollupBabel']
};
cfg.customLaunchers = {
ChromeDebugging: {
base: 'Chrome',
flags: ['--remote-debugging-port=9333']
}
};
}
config.set(cfg);
};