-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkarma.conf.js
77 lines (72 loc) · 2.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
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
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
var paths = {
base: '',
coverage: './coverage',
ng1: './src/client/app',
ng2: './src/client/ngsrc',
test: './test'
};
var dependencies = [
// bower:js
'bower_components/angular/angular.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/angular-messages/angular-messages.js',
'bower_components/angular-material/angular-material.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
// endbower
];
config.set({
basePath: paths.base,
files: []
.concat(dependencies)
.concat(paths.test + '/mocks/**/*.mock.js')
.concat([
paths.ng1 + '/app.module.js',
paths.ng1 + '/app.config.js',
paths.ng1 + '/app.run.js',
paths.ng1 + '/**/*.module.js',
paths.ng1 + '/**/!(*module).js'
]
),
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-spec-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage-istanbul-es5-preprocessor'),
require('@angular/cli/plugins/karma')
],
preprocessors: {
[paths.ng1 + '/**/!(*spec).js']: ['coverage-istanbul-es5']
},
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: paths.coverage,
reports: [ 'html', 'text-summary' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: [
'progress',
'coverage-istanbul',
'kjhtml'
],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false
});
};