blob: 36ddda1416d665e8cad7576670904bbabc83bcff [file] [log] [blame]
Matteo Scandolof0830892015-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 Scandolof5ab3ff2016-03-24 14:07:49 -070014var files = bowerComponents.concat([
Matteo Scandolo824a7cb2016-04-20 12:24:52 -070015 'node_modules/babel-polyfill/dist/polyfill.js',
Matteo Scandolo320ce2c2016-04-15 12:20:14 -070016 'xosHelpers/src/**/*.module.js',
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070017 'xosHelpers/src/**/*.js',
18 'xosHelpers/spec/**/*.test.js'
Matteo Scandoloa8ab5ae2016-05-03 15:45:28 -070019 // 'xosHelpers/spec/ui/smart-pie.test.js'
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070020]);
21
Matteo Scandolof0830892015-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 Scandolof5ab3ff2016-03-24 14:07:49 -070036 files: files,
Matteo Scandolof0830892015-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 Scandoloa7e64fd2016-04-14 14:59:09 -070047 'xosHelpers/**/*.js': ['babel'],
Matteo Scandolof0830892015-11-05 11:58:53 +010048 },
49
Matteo Scandolo89b179c2016-03-24 11:38:50 -070050 babelPreprocessor: {
51 options: {
52 presets: ['es2015'],
Matteo Scandolo5fe58df2016-04-26 16:34:56 -070053 sourceMap: 'both'
Matteo Scandolo89b179c2016-03-24 11:38:50 -070054 },
55 filename: function (file) {
56 return file.originalPath;
57 },
Matteo Scandolof0830892015-11-05 11:58:53 +010058 },
59
Matteo Scandolo89b179c2016-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 Scandolof0830892015-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 Scandolo3a55ad62016-04-26 10:10:54 -070081 logLevel: config.LOG_INFO,
Matteo Scandolof0830892015-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 Scandolo5fe58df2016-04-26 16:34:56 -070090 browsers: [
91 'PhantomJS',
Matteo Scandolo2e804cb2016-04-27 16:29:33 -070092 'Chrome'
Matteo Scandolo5fe58df2016-04-26 16:34:56 -070093 ],
Matteo Scandolof0830892015-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};