blob: 74a7ca71c9f8db73835533e63991113901b337cf [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',
71 outputFile: 'test-results.xml'
72 },
73
74 coverageReporter: {
75 type : 'cobertura',
76 dir : 'coverage/'
77 },
78
79 // web server port
80 port: 9876,
81
82
83 // enable / disable colors in the output (reporters and logs)
84 colors: true,
85
86
87 // level of logging
88 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
89 logLevel: config.LOG_ERROR,
90
91
92 // enable / disable watching file and executing tests whenever any file changes
93 autoWatch: false,
94
95
96 // start these browsers
97 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
98 browsers: ['PhantomJS'],
99
100
101 // Continuous Integration mode
102 // if true, Karma captures browsers, runs the tests and exits
103 singleRun: true
104 });
105};