-
Notifications
You must be signed in to change notification settings - Fork 175
/
karma.conf.js
52 lines (44 loc) · 1.14 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
const webpackConfig = require('./webpack.config');
webpackConfig.mode = 'none';
// still need Babel to use inject-loader
webpackConfig.module.rules.push({
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['es2015'],
plugins: ['babel-plugin-espower', 'istanbul'],
},
},
});
// enable-sourcemap
webpackConfig.devtool = 'inline-source-map';
module.exports = config =>
config.set({
files: [
// if specify running tests
// './tests/peer/sfuRoom.js',
'./tests/index.js',
],
singleRun: true,
frameworks: ['mocha'],
webpack: webpackConfig,
preprocessors: {
// if specify running tests
// './tests/peer/sfuRoom.js': ['webpack', 'sourcemap'],
'./tests/index.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
coverageReporter: {
dir: './coverage',
reporters: [{ type: 'html' }, { type: 'text' }],
},
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
});