-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathkarma.conf.js
More file actions
160 lines (139 loc) · 5.28 KB
/
Copy pathkarma.conf.js
File metadata and controls
160 lines (139 loc) · 5.28 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
module.exports = function(config) {
"use strict";
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "",
// How long will Karma wait for a message from a browser before disconnecting from it (in ms).
browserNoActivityTimeout: 2000000,
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["openui5", "qunit"],
// list of files / patterns to load in the browser
files: [
{ pattern: "src/ui5lab/striptoastr/**", included: false, served: true, watched: false, nocache: false },
"test/ui5lab/striptoastr/qunit/StripToastr.js",
{ pattern: "test/ui5lab/striptoastr/qunit/**/*.*", included: false, served: true }
],
// list of files to exclude
exclude: [
"dist/**/"
],
// In case an absolute URL is used at some point of the code, a proxy configuration is required.
proxies: {
"/src/": "/base/src/",
"/test/": "/base/test/"
},
// test results reporter to use
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["progress", "coverage", "coveralls"],
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
preprocessors: {
"src/**/": ["coverage"]
},
// Configuration of coverage reporter
// check coverage thresholds
// output summary to the CLI
// output lcov for coveralls
coverageReporter: {
check: {
global: {
statements: 60,
branches: 60,
functions: 60,
lines: 60,
excludes: []
}
},
dir: "reports/coverage",
subdir: function() {
return "";
},
reporters: [{
type: "text-summary"
}, {
type: "html",
subdir: "html"
}, {
type: "lcovonly",
subdir: "lcov"
}]
},
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ["PhantomJS_custom"], //*/ ["Chrome"],
// Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
phantomjsLauncher: {
exitOnResourceError: false
},
// you can define custom flags
customLaunchers: {
"PhantomJS_custom": {
base: "PhantomJS",
options: {
viewportSize: {
width: 1440,
height: 900
},
customHeaders: {
DNT: "1"
},
windowName: "my-window",
settings: {
webSecurityEnabled: false,
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36"
}
},
flags: ["--load-images=true", "--debug=false", "--disk-cache=false"],
debug: true
}
},
openui5: {
path: "https://openui5.hana.ondemand.com/1.40.4/resources/sap-ui-core.js",
useMockServer: false
},
// How the client should execute the test, like run in an iframe, capture the console and so on.
client: {
captureConsole: true,
clearContext: true,
useIframe: false,
qunit: {
showUI: true,
testTimeout: 15000,
autostart: false,
autoload: false
},
openui5: {
config: {
// theme: "sap_belize",
libs: "sap.m, ui5lab.striptoastr",
// compatVersion: "edge",
// frameOptions: "allow",
// preload: "async",
// animation: "false",
debug: "false",
resourceroots: {
"ui5lab": "/src/ui5lab",
"test.unit": "/test/ui5lab/striptoastr/qunit"
}
}
}
},
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_ERROR,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
hostname: "127.0.0.1",
port: 9876
});
};