forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
154 lines (125 loc) · 5.25 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
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
const jsdom = require("jsdom");
module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../..',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
// Jasmine plugins
//libraries
'node_modules/jquery/dist/jquery.min.js',
'node_modules/angular/angular.min.js',
'node_modules/angular-animate/angular-animate.min.js',
'node_modules/angular-cookies/angular-cookies.min.js',
'node_modules/angular-aria/angular-aria.min.js',
'node_modules/angular-local-storage/dist/angular-local-storage.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/angular-sanitize/angular-sanitize.min.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/angular-ui-sortable/dist/sortable.min.js',
'node_modules/underscore/underscore-min.js',
'node_modules/moment/min/moment-with-locales.js',
'lib/umbraco/Extensions.js',
'node_modules/lazyload-js/LazyLoad.min.js',
'node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js',
//app bootstrap and loader
'test/config/app.unit.js',
//application files
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.controllers.min.js',
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.directives.min.js',
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.filters.min.js',
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.services.min.js',
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.interceptors.min.js',
'../Umbraco.Cms.StaticAssets/wwwroot/umbraco/js/*.resources.min.js',
//mocked data and routing
'src/common/mocks/umbraco.servervariables.js',
'src/common/mocks/**/*.js',
//tests
'test/unit/**/*.spec.js'
],
// list of files to exclude
exclude: [],
// use dolts reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress', 'junit', 'spec'
// ***
// progress: Outputs a simple list like: "Executed 128 of 144 SUCCESS (0 secs / 0.814 secs)"
// spec: Outputs a more verbose report which is more useful for debugging if one of the tests fails.
// ***
// CLI --reporters progress
reporters: ['spec', 'junit'],
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: true, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: false, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: false // print the time elapsed for each spec
},
// web server port
// CLI --port 9876
port: 9876,
// cli runner port
// CLI --runner-port 9100
runnerPort: 9100,
// Add support for new DNS resolution in Node 17+
listenAddress: '::',
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,
// level of logging
// possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG
// CLI --log-level debug
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: ['jsdom'],
// Configure a user agent so the log file gets generated properly
jsdomLauncher: {
jsdom: {
resources: new jsdom.ResourceLoader({
userAgent: "umbraco-test-suite"
})
}
},
// allow waiting a bit longer, some machines require this
browserNoActivityTimeout: 100000, // default 10,000ms
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500,
plugins: [
require('karma-jasmine'),
require('karma-jsdom-launcher'),
require('karma-junit-reporter'),
require('karma-spec-reporter')
],
// the default configuration
junitReporter: {
outputDir: '', // results will be saved as $outputDir/$browserName.xml
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: '', // suite will become the package name attribute in xml testsuite element
useBrowserName: true, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},
client: {
jasmine: {
random: false
}
}
});
};