blob: b602d66805601d79d3c1b0de2e905b527df5bbab [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([
15 'api/**/*.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'
19]);
20
Matteo Scandolof0830892015-11-05 11:58:53 +010021module.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
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070035 files: files,
Matteo Scandolof0830892015-11-05 11:58:53 +010036
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: {
Matteo Scandoloa7e64fd2016-04-14 14:59:09 -070046 'xosHelpers/**/*.js': ['babel'],
Matteo Scandolof0830892015-11-05 11:58:53 +010047 },
48
Matteo Scandolo89b179c2016-03-24 11:38:50 -070049 babelPreprocessor: {
50 options: {
51 presets: ['es2015'],
52 sourceMap: 'inline'
53 },
54 filename: function (file) {
55 return file.originalPath;
56 },
Matteo Scandolof0830892015-11-05 11:58:53 +010057 },
58
Matteo Scandolo89b179c2016-03-24 11:38:50 -070059 //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
Matteo Scandolof0830892015-11-05 11:58:53 +010064 // test results reporter to use
65 // possible values: 'dots', 'progress'
66 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
67 reporters: ['mocha'],
68
69
70 // web server port
71 port: 9876,
72
73
74 // enable / disable colors in the output (reporters and logs)
75 colors: true,
76
77
78 // level of logging
79 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Matteo Scandolo6297a262016-03-24 15:11:29 -070080 logLevel: config.LOG_ERROR,
Matteo Scandolof0830892015-11-05 11:58:53 +010081
82
83 // enable / disable watching file and executing tests whenever any file changes
84 autoWatch: true,
85
86
87 // start these browsers
88 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandolo6a6586e2016-04-14 16:52:13 -070089 browsers: ['PhantomJS'],
Matteo Scandolof0830892015-11-05 11:58:53 +010090
91
92 // Continuous Integration mode
93 // if true, Karma captures browsers, runs the tests and exits
94 singleRun: false
95 });
96};