blob: 0a786837d72a21016ece5ddea512ab3e90701d0e [file] [log] [blame]
Matteo Scandolo57483dd2015-11-05 11:58:53 +01001// 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
Matteo Scandolo061094b2016-03-24 14:07:49 -070014var files = bowerComponents.concat([
Matteo Scandolocc6954e2016-04-15 12:20:14 -070015 'xosHelpers/src/**/*.module.js',
Matteo Scandolo061094b2016-03-24 14:07:49 -070016 'xosHelpers/src/**/*.js',
17 'xosHelpers/spec/**/*.test.js'
18]);
19
Matteo Scandolo57483dd2015-11-05 11:58:53 +010020module.exports = function(config) {
21/*eslint-enable*/
22 config.set({
23
24 // base path that will be used to resolve all patterns (eg. files, exclude)
25 basePath: '',
26
27
28 // frameworks to use
29 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
30 frameworks: ['jasmine'],
31
32
33 // list of files / patterns to load in the browser
Matteo Scandolo061094b2016-03-24 14:07:49 -070034 files: files,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010035
36
37 // list of files to exclude
38 exclude: [
39 ],
40
41
42 // preprocess matching files before serving them to the browser
43 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
44 preprocessors: {
Matteo Scandolo9e6c6fc2016-04-14 14:59:09 -070045 'xosHelpers/**/*.js': ['babel'],
Matteo Scandolo57483dd2015-11-05 11:58:53 +010046 },
47
Matteo Scandolo8420f622016-03-24 11:38:50 -070048 babelPreprocessor: {
49 options: {
50 presets: ['es2015'],
51 sourceMap: 'inline'
52 },
53 filename: function (file) {
54 return file.originalPath;
55 },
Matteo Scandolo57483dd2015-11-05 11:58:53 +010056 },
57
Matteo Scandolo8420f622016-03-24 11:38:50 -070058 //ngHtml2JsPreprocessor: {
59 // 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)
60 // moduleName: 'templates' // define the template module name
61 //},
62
Matteo Scandolo57483dd2015-11-05 11:58:53 +010063 // test results reporter to use
64 // possible values: 'dots', 'progress'
65 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
66 reporters: ['mocha'],
67
68
69 // web server port
70 port: 9876,
71
72
73 // enable / disable colors in the output (reporters and logs)
74 colors: true,
75
76
77 // level of logging
78 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Matteo Scandolo7dea2432016-03-24 15:11:29 -070079 logLevel: config.LOG_ERROR,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010080
81
82 // enable / disable watching file and executing tests whenever any file changes
83 autoWatch: true,
84
85
86 // start these browsers
87 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandoloa6a9e612016-04-14 16:52:13 -070088 browsers: ['PhantomJS'],
Matteo Scandolo57483dd2015-11-05 11:58:53 +010089
90
91 // Continuous Integration mode
92 // if true, Karma captures browsers, runs the tests and exits
93 singleRun: false
94 });
95};