blob: 49f72a154ec1cd832b40bc089755c3d0decb9a53 [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 Scandolo9f0e5ae2016-04-20 12:24:52 -070015 'node_modules/babel-polyfill/dist/polyfill.js',
Matteo Scandolocc6954e2016-04-15 12:20:14 -070016 'xosHelpers/src/**/*.module.js',
Matteo Scandolo061094b2016-03-24 14:07:49 -070017 'xosHelpers/src/**/*.js',
18 'xosHelpers/spec/**/*.test.js'
Matteo Scandoloe2ee2d92016-04-27 15:58:16 -070019 // 'xosHelpers/spec/ui/form.test.js'
Matteo Scandolo061094b2016-03-24 14:07:49 -070020]);
21
Matteo Scandolo57483dd2015-11-05 11:58:53 +010022module.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
Matteo Scandolo061094b2016-03-24 14:07:49 -070036 files: files,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010037
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: {
Matteo Scandolo9e6c6fc2016-04-14 14:59:09 -070047 'xosHelpers/**/*.js': ['babel'],
Matteo Scandolo57483dd2015-11-05 11:58:53 +010048 },
49
Matteo Scandolo8420f622016-03-24 11:38:50 -070050 babelPreprocessor: {
51 options: {
52 presets: ['es2015'],
Matteo Scandoloa9524672016-04-26 16:34:56 -070053 sourceMap: 'both'
Matteo Scandolo8420f622016-03-24 11:38:50 -070054 },
55 filename: function (file) {
56 return file.originalPath;
57 },
Matteo Scandolo57483dd2015-11-05 11:58:53 +010058 },
59
Matteo Scandolo8420f622016-03-24 11:38:50 -070060 //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
Matteo Scandolo57483dd2015-11-05 11:58:53 +010065 // test results reporter to use
66 // possible values: 'dots', 'progress'
67 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
68 reporters: ['mocha'],
69
70
71 // web server port
72 port: 9876,
73
74
75 // enable / disable colors in the output (reporters and logs)
76 colors: true,
77
78
79 // level of logging
80 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Matteo Scandoloba1d35c2016-04-26 10:10:54 -070081 logLevel: config.LOG_INFO,
Matteo Scandolo57483dd2015-11-05 11:58:53 +010082
83
84 // enable / disable watching file and executing tests whenever any file changes
85 autoWatch: true,
86
87
88 // start these browsers
89 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandoloa9524672016-04-26 16:34:56 -070090 browsers: [
91 'PhantomJS',
Matteo Scandolo6ba12872016-04-27 16:29:33 -070092 'Chrome'
Matteo Scandoloa9524672016-04-26 16:34:56 -070093 ],
Matteo Scandolo57483dd2015-11-05 11:58:53 +010094
95
96 // Continuous Integration mode
97 // if true, Karma captures browsers, runs the tests and exits
98 singleRun: false
99 });
100};