This repository has been archived by the owner on Nov 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
karma.conf.ts
58 lines (50 loc) · 1.52 KB
/
karma.conf.ts
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
import { Config, ConfigOptions } from 'karma'
import webpackConfig from './webpack.test.config'
export default (config: Config): void => {
config.set({
frameworks: ['mocha', 'chai', 'sinon'],
files: [
{
pattern: 'src/**/*.ts',
watched: false,
included: true,
served: true,
},
],
preprocessors: {
'src/**/*.ts?(x)': ['webpack', 'sourcemap'],
},
// Ignore the npm package entry point
exclude: ['src/index.ts'],
// karma-webpack doesn't change the file extensions so we just need to tell karma what these extensions mean.
mime: {
'text/x-typescript': ['ts'],
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only',
bail: true,
},
browsers: ['Chrome', 'Firefox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
// CI runs as root so we need to disable sandbox
flags: ['--no-sandbox', '--disable-setuid-sandbox'],
},
},
reporters: ['mocha', 'coverage-istanbul'],
mochaReporter: {
showDiff: true,
},
client: {
mocha: {
timeout: 6000,
},
},
coverageIstanbulReporter: {
reports: ['json'],
fixWebpackSourcePaths: true,
},
} as ConfigOptions)
}