-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
118 lines (94 loc) · 3.13 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
// Karma configuration
// Generated on Tue Jul 02 2013 17:07:14 GMT+0200 (Paris, Madrid (heure d’été))
module.exports = function(karma) {
karma.set({
// base path, that will be used to resolve files and exclude
basePath: 'test',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'../node_modules/es5-shim/es5-shim.js',
'../bower_components/jquery/dist/jquery.js',
'../bower_components/lodash/dist/lodash.js',
'../bower_components/angular/angular.js',
'../bower_components/angular-mocks/angular-mocks.js',
'../bower_components/angular-resource/angular-resource.js',
'../bower_components/angular-sanitize/angular-sanitize.js',
'../bower_components/angular-animate/angular-animate.js',
'../bower_components/angular-local-storage/dist/angular-local-storage.js',
'../bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js',
'../node_modules/ng-directive-compiler-helper/lib/ng-directive-compiler-helper.js',
'../app/assets/views/**.html',
'../app/assets/views/*/**.html',
'../app/js/**/*.js',
'mocks/**.js',
'unit/**/*.spec.js'
],
// list of files to exclude
exclude: [''],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['dots', 'coverage'],
// web server port
port: 9005,
// cli runner port
runnerPort: 9100,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG
logLevel: karma.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
preprocessors: {
'../app/js/**/*.js': ['babel', 'coverage'],
'../app/assets/**/*.html': ['ng-html2js'],
'unit/**/*.js': ['babel']
},
coverageReporter: {
type: 'lcov',
dir: '../coverage/'
},
ngHtml2JsPreprocessor: {
moduleName: 'orodarius.templates',
cacheIdFromPath: function(filepath) {
return filepath.match(/(?:\/)(views\/.*\.html?$)/)[1];
}
},
babelPreprocessor: {
options: {
presets: ['es2015'],
sourceMap: 'inline'
}
},
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Safari
// - PhantomJS
// - IE (only Windows)
// - iOS (only Mac)
browsers: ['PhantomJS'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
reportSlowerThan: 500,
proxies: {
'/': 'https://localhost:3333/'
},
// urlRoot: '__karma__',
urlRoot: '',
plugins: [
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-ng-html2js-preprocessor',
'karma-babel-preprocessor'
]
});
};