blob: 2dcf1996ebc0d057c70ee7f9e238ba1fb243188a [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',
18 'xosHelpers/src/**/*.module.js',
19 'xosHelpers/src/**/*.js',
20 'xosHelpers/spec/**/*.test.js'
21]);
22
23module.exports = function(config) {
24/*eslint-enable*/
25 config.set({
26
27 // base path that will be used to resolve all patterns (eg. files, exclude)
28 basePath: '',
29
30
31 // frameworks to use
32 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
33 frameworks: ['jasmine'],
34
35
36 // list of files / patterns to load in the browser
37 files: files,
38
39
40 // list of files to exclude
41 exclude: [
42 ],
43
44
45 // preprocess matching files before serving them to the browser
46 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
47 preprocessors: {
48 'xosHelpers/**/*.js': ['babel', 'coverage'],
49 },
50
51 babelPreprocessor: {
52 options: {
53 presets: ['es2015'],
54 sourceMap: 'inline'
55 },
56 filename: function (file) {
57 return file.originalPath;
58 },
59 },
60
61 //ngHtml2JsPreprocessor: {
62 // 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)
63 // moduleName: 'templates' // define the template module name
64 //},
65
66 // test results reporter to use
67 // possible values: 'dots', 'progress'
68 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
69 reporters: ['dots', 'junit', 'coverage'],
70
71 junitReporter: {
72 outputDir: 'test-result',
Matteo Scandolo3fa32c62016-04-20 17:00:01 -070073 useBrowserName: false,
Matteo Scandolo23254d12016-04-20 16:50:29 -070074 outputFile: 'test-results.xml'
75 },
76
77 coverageReporter: {
Matteo Scandolo3fa32c62016-04-20 17:00:01 -070078 type: 'cobertura',
79 subdir: '.',
80 dir: 'test-result/'
Matteo Scandolo23254d12016-04-20 16:50:29 -070081 },
82
83 // web server port
84 port: 9876,
85
86
87 // enable / disable colors in the output (reporters and logs)
88 colors: true,
89
90
91 // level of logging
92 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
93 logLevel: config.LOG_ERROR,
94
95
96 // enable / disable watching file and executing tests whenever any file changes
97 autoWatch: false,
98
99
100 // start these browsers
101 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
102 browsers: ['PhantomJS'],
103
104
105 // Continuous Integration mode
106 // if true, Karma captures browsers, runs the tests and exits
107 singleRun: true
108 });
109};