-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathkarma.conf.js
123 lines (103 loc) · 5 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// #docregion
const path = require('path');
module.exports = function(config) {
var appBase = 'out/src/views/htmlcontent/dist/'; // transpiled app JS and map files
var appSrcBase = 'src/views/htmlcontent/src/js/'; // app source TS files
var appAssets = 'base/out/src/views/htmlcontent/'; // component assets fetched by Angular's compiler
var testBase = 'out/src/views/htmlcontent/test/'; // transpiled test JS and map files
var testSrcBase = 'src/views/htmlcontent/test/'; // test source TS files
config.set({
basePath: path.join(__dirname),
frameworks: ['jasmine'],
plugins: [
require('karma-remap-istanbul'),
require('karma-coverage'),
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it
require('karma-junit-reporter')
],
files: [
'out/src/views/htmlcontent/lib/js/jquery-1.7.min.js',
'out/src/views/htmlcontent/lib/js/jquery.event.drag-2.2.js',
'out/src/views/htmlcontent/lib/js/jquery-ui-1.8.16.custom.min.js',
'out/src/views/htmlcontent/lib/js/underscore-min.js',
'out/src/views/htmlcontent/lib/js/slick.core.js',
'out/src/views/htmlcontent/lib/js/slick.grid.js',
'out/src/views/htmlcontent/lib/js/slick.editors.js',
'out/src/views/htmlcontent/lib/js/slick.autosizecolumn.js',
'out/src/views/htmlcontent/lib/js/slick.dragrowselector.js',
// System.js for module loading
'out/src/views/htmlcontent/lib/js/system.src.js',
// Polyfills
'out/src/views/htmlcontent/lib/js/shim.min.js',
'out/src/views/htmlcontent/lib/js/Reflect.js',
// zone.js
'out/src/views/htmlcontent/lib/js/zone.js/dist/zone.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/long-stack-trace-zone.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/proxy.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/sync-test.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/jasmine-patch.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/async-test.js',
'out/src/views/htmlcontent/lib/js/zone.js/dist/fake-async-test.js',
// RxJs
{ pattern: 'out/src/views/htmlcontent/lib/js/rxjs/**/*.js', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/rxjs/**/*.js.map', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/angular2-slickgrid/**/*.js', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/angular2-slickgrid/**/*.js.map', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/json.js', included: false, watched: false},
// Paths loaded via module imports:
// Angular itself
{ pattern: 'out/src/views/htmlcontent/lib/js/@angular/**/*.js', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/@angular/**/*.js.map', included: false, watched: false },
{ pattern: 'out/src/views/htmlcontent/lib/js/systemjs.config.js', included: false, watched: false },
'karma-test-shim.js',
// transpiled application & spec code paths loaded via module imports
{ pattern: appBase + '**/*.js', included: false, watched: true },
{ pattern: appBase + '**/*.json', included: false, watched: false },
{ pattern: testBase + '**/*.js', included: false, watched: false },
// Asset (HTML & CSS) paths loaded via Angular's component compiler
// (these paths need to be rewritten, see proxies section)
{ pattern: appBase + '**/*.html', included: false, watched: false },
{ pattern: appBase + '**/*.css', included: false, watched: false },
// Paths for debugging with source maps in dev tools
{ pattern: appSrcBase + '**/*.ts', included: false, watched: false },
{ pattern: appBase + '**/*.js.map', included: false, watched: false },
{ pattern: testSrcBase + '**/*.ts', included: false, watched: false },
{ pattern: testBase + '**/*.js.map', included: false, watched: false }
],
// Proxied base paths for loading assets
proxies: {
// required for component assets fetched by Angular's compiler
"/dist/": 'base/out/src/views/htmlcontent/dist/',
"/base/out/src/views/htmlcontent/src/": '/base/out/src/views/htmlcontent/dist/'
},
exclude: [],
preprocessors: {
'out/src/views/htmlcontent/dist/**/!(*spec)*.js': 'coverage',
},
reporters: ['progress', 'coverage', 'karma-remap-istanbul', 'junit'],
coverageReporter: {
dir : 'coverage/',
reporters: [
{type: 'json'}
]
},
remapIstanbulReporter: {
reports: {
json: 'coverage/coverage-html.json',
// uncomment below for html only coverage
// html: 'coverage/htmlcoverage/'
}
},
junitReporter: {
outputDir: 'test-reports/'
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: true
})
}