-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
104 lines (82 loc) · 3.13 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
99
100
101
102
103
104
var webpackConfig = require('./webpack.test');
module.exports = function (config) {
var _config = {
basePath: '.',
frameworks: ['jasmine-ajax', 'jasmine'],
files: [
'./node_modules/hammerjs/hammer.js',
{pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: false},
//diagrams
'./node_modules/chart.js/dist/Chart.js',
'./node_modules/alfresco-js-api/dist/alfresco-js-api.js',
'./node_modules/raphael/raphael.js',
'./node_modules/moment/min/moment.min.js',
'./node_modules/md-date-time-picker/dist/js/mdDateTimePicker.js',
{pattern: './node_modules/ng2-translate/**/*.js', included: false, watched: false},
{pattern: './node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false},
{pattern: './node_modules/md-date-time-picker/**/*.js', included: false, served: true, watched: false},
{pattern: './node_modules/moment/**/*.js', included: false, served: true, watched: false},
{pattern: 'karma-test-shim.js', watched: false},
{pattern: './src/assets/**/*.*', included: false, served: true, watched: false},
{pattern: './src/i18n/**/*.*', included: false, served: true, watched: false},
{pattern: './src/**/*.ts', included: false, served: true, watched: false}
],
webpack: (config.mode === 'coverage') ? require('./webpack.coverage') : require('./webpack.test'),
webpackMiddleware: {
stats: 'errors-only'
},
port: 9876,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
colors: true,
autoWatch: true,
captureTimeout: 180000,
browserDisconnectTimeout: 180000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 300000,
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
// Karma plugins loaded
plugins: [
require('./node_modules/karma-jasmine'),
require('./node_modules/karma-coverage'),
require('./node_modules/karma-sourcemap-loader'),
require('./node_modules/karma-jasmine-ajax'),
require('./node_modules/karma-chrome-launcher'),
require('./node_modules/karma-mocha-reporter'),
require('./node_modules/karma-webpack'),
require('./node_modules/karma-jasmine-html-reporter')
],
webpackServer: {
noInfo: true
},
// Coverage reporter generates the coverage
reporters: ['mocha', 'coverage', 'kjhtml'],
preprocessors: {
'karma-test-shim.js': ['webpack', 'sourcemap'],
'./src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
},
coverageReporter: {
includeAllSources: true,
dir: 'coverage',
subdir: 'report',
reporters: [
{type: 'text'},
{type: 'text-summary'},
{type: 'json', file: 'coverage-final.json'},
{type: 'html'},
{type: 'lcov'}
]
}
};
if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
}
config.set(_config);
};