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