-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.conf.js
118 lines (89 loc) · 2.75 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
// Setup ChromeHeadless
// see https://github.com/karma-runner/karma-chrome-launcher
const ChromiumRevision = require('puppeteer/package.json').puppeteer.chromium_revision;
const Downloader = require('puppeteer/utils/ChromiumDownloader');
const revisionInfo = Downloader.revisionInfo(Downloader.currentPlatform(), ChromiumRevision);
process.env.CHROME_BIN = revisionInfo.executablePath;
module.exports = function(config) {
config.set({
basePath: 'webapp',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['qunit', 'openui5'],
openui5: {
path: 'https://sapui5.hana.ondemand.com/resources/sap-ui-core.js',
useMockServer: true
},
// plugin settings
client: {
openui5: {
config: {
theme: 'sap_belize',
resourceRoots: {
'ui5experts.ui-testing': '/base',
'test.unit': '/base/test/unit'
}
},
mockserver: {
config: {
autoRespond: true
},
rootUri: '',
metadataURL: '/base/localService/metadata.xml',
mockdataSettings: {
}
}
},
qunit: {
showUI: true,
testTimeout: 3000
}
},
// list of files / patterns to load in the browser
files: [
{
pattern: 'test/unit/allTests.js',
watched: true,
included: true,
served: true
},
{
pattern: '**',
watched: true,
included: false,
served: true
}
],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// use '--browsers ChromeHeadless' to override from CLI
browsers: ['Chrome'],
customLaunchers: {
Chrome_without_security: {
base: 'Chrome',
flags: ['--disable-web-security']
}
},
// test results reporter to use
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
// 'progress' = default test result output to console
reporters: ['progress', 'junit', 'coverage'],
junitReporter: {
outputDir: '../build/reports/unit',
useBrowserName: false
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'!(test)/**/*.js': ['coverage'], // exclude tests from coverage
'*.js': ['coverage']
},
coverageReporter: {
includeAllSources: true,
dir: '../build/reports/coverage'
}
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
// singleRun: false // use '--single-run' to override from CLI
});
};