This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
karma.conf.js
98 lines (92 loc) · 2.22 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
const path = require('path');
module.exports = config => {
config.set({
basePath: '',
singleRun: true,
browsers: ['ChromeHeadlessNoSandbox', 'FirefoxHeadless'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--disable-gpu', '--no-sandbox']
},
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless']
}
},
frameworks: ['mocha', 'sinon-chai'],
files: [
{
pattern: 'node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js',
watched: false
},
{
pattern: 'node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js',
watched: false
},
'test/unit/index.js'
],
preprocessors: {
'test/unit/index.js': ['webpack', 'sourcemap']
},
reporters: ['dots', 'coverage-istanbul'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
dir: path.join(__dirname, 'coverage'),
combineBrowserReports: true,
skipFilesWithNoCoverage: true,
thresholds: {
global: {
statements: 90,
lines: 90,
branches: 90,
functions: 90
}
}
},
client: {
mocha: {
reporter: 'html',
ui: 'bdd'
},
chai: {
includeStack: true
}
},
webpack: {
devtool: 'inline-source-map',
mode: 'development',
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules\/(?!(@webcomponents\/shadycss|lit-element|lit-html|@aybolit)\/).*/,
options: {
cacheDirectory: true
}
},
{
test: /\.js$/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post',
include: path.resolve('./packages/core'),
exclude: /node_modules|\.spec\.js$/,
options: {
esModules: true
}
}
]
}
},
webpackMiddleware: {
stats: 'errors-only'
},
webpackServer: {
noInfo: true
}
});
};