-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.ci.conf.js
144 lines (117 loc) · 4.51 KB
/
karma.ci.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
// Karma configuration
// Generated on Tue Oct 20 2015 16:52:59 GMT+0200 (CEST)
module.exports = function(config) {
config.set({
// Base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '.',
// Use proxy to out stub server which is launched on port 3000
// Used in couple with ng-scenario plugin to make integration tests
proxies: {
'/': 'http://localhost:3000'
},
urlRoot: '/__karma__/',
// Frameworks to use
// Available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine-ajax', 'jasmine'],
// Uncomment to have control on all the used packages
// By default all plugins are included
// plugins: ['karma-jasmine', 'karma-chrome-launcher', 'karma-commonjs-preprocessor', 'karma-html2js-preprocessor', 'karma-json-fixtures-preprocessor', 'karma-jasmine-html-reporter', 'karma-coverage', 'karma-jasmine-ajax', 'karma-phantomjs-launcher'],
// List of files / patterns to load in the browser
files: [
'node_modules/commonjs-require-definition/require.js',
// 'node_modules/karma-jasmine-ajax/node_modules/jasmine-ajax/lib/mock-ajax.js',
'vendor/jquery-1.11.1.js',
'vendor/jquery.mobile-1.3.2.js',
'vendor/jquery.auto-complete.js',
'vendor/jquery.imagesloaded.js',
'vendor/jqm-datebox-1.4.0.js',
'vendor/lodash.js',
'vendor/backbone.js',
'vendor/*.js',
/* Use source code as source */
// Depend on source code, but need to load templates manually since there is no existing package for karma
'client/js/**/*.js',
'output-dev/js/main-templates.js', // Use main-templates generated by brunch from output-dev
/* Use generated code as source */
// Depend on output version (no problem with templates : but have no source files..)
//'output-dev/js/**/*.js',
// Mocks
'stub_server/**/*.json',
'client/conf/*.json',
'client/tests/integration/**/*.spec.js'
],
// List of files to exclude
exclude: [],
// Preprocess matching files before serving them to the browser
// Available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
// Uncomment to generate coverage (commented to debug more easily)
'**/client/js/**/*.js': ['coverage'],
// Comment in case when files loaded to browser is generated code(cf 'files')
'client/js/**/*.js': ['commonjs'],
'stub_server/**/*.json': ['json_fixtures'],
'client/conf/*.json': ['json_fixtures']
},
// Configure the reporter
coverageReporter: {
dir: 'client/tests/report/',
reporters: [{
type: 'html',
subdir: 'html-coverage'
}, {
type: 'cobertura',
subdir: '.'
}, {
type: 'lcov',
subdir: './lcov'
}]
},
// Replace
commonjsPreprocessor: {
options: {
pathReplace: function(path) {
var newPath = path.replace(/^client[\\\/](js[\\\/]|)/, '');
return newPath;
}
}
},
// Test results reporter to use
// possible values: 'dots', 'progress'
// Available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'html', 'coverage', 'junit'],
junitReporter: {
outputDir: 'client/tests/report/',
outputFile: './jenkins-report.xml',
useBrowserName: false
},
// The default configuration
htmlReporter: {
outputDir: 'karma_html', // where to put the reports
templatePath: null, // set if you moved jasmine_template.html
focusOnFailures: true, // reports show failures on start
namedFiles: false, // name files instead of creating sub-directories
pageTitle: null, // page title for reports; browser info by default
urlFriendlyName: false, // simply replaces spaces with _ for files/dirs
reportName: 'report-summary-filename', // report summary filename; browser info by default
// Experimental
preserveDescribeNesting: false, // folded suites stay folded
foldAll: false, // reports start folded (only with preserveDescribeNesting)
},
// Web server port
port: 9876,
// 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_INFO,
// Enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers
// Available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
//browsers: ['Chrome'],
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
})
}