blob: c76d02976490a36061e2521b1d936324690ab2fb [file] [log] [blame]
Matteo Scandolo23254d12016-04-20 16:50:29 -07001// Karma configuration
2// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
3
4/* eslint indent: [2,2], quotes: [2, "single"]*/
5
Matteo Scandolocd1aceb2016-04-20 17:06:27 -07006// CONFIGURATION FOR JENKINS TESTS
7
Matteo Scandolo23254d12016-04-20 16:50:29 -07008/*eslint-disable*/
9var wiredep = require('wiredep');
10var path = require('path');
11
12var bowerComponents = wiredep({devDependencies: true})[ 'js' ].map(function( file ){
13 return path.relative(process.cwd(), file);
14});
15
16var files = bowerComponents.concat([
17 'node_modules/babel-polyfill/dist/polyfill.js',
Matteo Scandoloc11285d2016-04-26 10:12:25 -070018 '../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
Matteo Scandolo23254d12016-04-20 16:50:29 -070019 'xosHelpers/spec/**/*.test.js'
20]);
21
22module.exports = function(config) {
23/*eslint-enable*/
24 config.set({
25
26 // base path that will be used to resolve all patterns (eg. files, exclude)
27 basePath: '',
28
29
30 // frameworks to use
31 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
32 frameworks: ['jasmine'],
33
34
35 // list of files / patterns to load in the browser
36 files: files,
37
38
39 // list of files to exclude
40 exclude: [
41 ],
42
43
44 // preprocess matching files before serving them to the browser
45 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
46 preprocessors: {
47 'xosHelpers/**/*.js': ['babel', 'coverage'],
48 },
49
50 babelPreprocessor: {
51 options: {
52 presets: ['es2015'],
53 sourceMap: 'inline'
54 },
55 filename: function (file) {
56 return file.originalPath;
57 },
58 },
59
60 //ngHtml2JsPreprocessor: {
61 // stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
62 // moduleName: 'templates' // define the template module name
63 //},
64
65 // test results reporter to use
66 // possible values: 'dots', 'progress'
67 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
68 reporters: ['dots', 'junit', 'coverage'],
69
70 junitReporter: {
71 outputDir: 'test-result',
Matteo Scandolo3fa32c62016-04-20 17:00:01 -070072 useBrowserName: false,
Matteo Scandolo23254d12016-04-20 16:50:29 -070073 outputFile: 'test-results.xml'
74 },
75
76 coverageReporter: {
Matteo Scandolo3fa32c62016-04-20 17:00:01 -070077 type: 'cobertura',
78 subdir: '.',
79 dir: 'test-result/'
Matteo Scandolo23254d12016-04-20 16:50:29 -070080 },
81
82 // web server port
83 port: 9876,
84
85
86 // enable / disable colors in the output (reporters and logs)
87 colors: true,
88
89
90 // level of logging
91 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
92 logLevel: config.LOG_ERROR,
93
94
95 // enable / disable watching file and executing tests whenever any file changes
96 autoWatch: false,
97
98
99 // start these browsers
100 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
101 browsers: ['PhantomJS'],
102
103
104 // Continuous Integration mode
105 // if true, Karma captures browsers, runs the tests and exits
106 singleRun: true
107 });
108};