This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
karma.conf.js
73 lines (64 loc) · 2.54 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
module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'karma-typescript'],
files: [
{ pattern: "src/base.spec.ts" },
{ pattern: "src/app/**/*.+(ts|html)" },
],
plugins: [
'karma-chrome-launcher',
'karma-jasmine',
'karma-typescript',
'karma-coverage',
'karma-mocha',
'karma-mocha-reporter'
],
exclude: [
'src/app/shared/wit-api.provider.ts', // this class produces some errors when compiled in test mode
'src/app/services/login.service.ts', // this requires some dependency from runtime, so exclude it
'src/tests/*', // excluding files for functional test and page objects
'tests/*' // excluding files for functional test and page objects
],
preprocessors: {
"**/*.ts": ["karma-typescript"]
},
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
transforms: [
require("karma-typescript-angular2-transform"),
require("karma-typescript-es6-transform")()
],
//not excluding ngx-widgets from the bundling causes syntax errors in the final bundle(?!).
// exclude: ['ngx-widgets']
},
compilerOptions: {
lib: ["ES2015", "DOM"]
},
exclude: [
'dist',
'node_modules',
'runtime', // explicitly exclude the runtime here
'src/app/shared/wit-api.provider.ts', // this class produces some errors when compiled in test mode
'src/app/services/login.service.ts', // this requires some dependency from runtime, so exclude it
'src/tests/*', // excluding files for functional test and page objects
'tests/*' // excluding files for functional test and page objects
]
},
reporters: ['mocha', 'coverage'],
coverageReporter: {
reporters: [{type: 'json', dir: './coverage'}]
},
// See https://github.com/karma-runner/karma-chrome-launcher/issues/158#issuecomment-339265457
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
singleRun: true
});
};
// ADD to check logs
// logLevel: config.LOG_DEBUG