blob: ed2ec3eb29d5c8abb02633ef918d3030d9dcb8e3 [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
Matteo Scandolo2b38f622016-05-04 17:22:45 -07006// this is to load a different suite of test while developing
7var testFiles = '*';
8if(process.argv[4]){
9 testFiles = process.argv[4];
10}
11
Matteo Scandolof0830892015-11-05 11:58:53 +010012/*eslint-disable*/
13var wiredep = require('wiredep');
14var path = require('path');
15
16var bowerComponents = wiredep({devDependencies: true})[ 'js' ].map(function( file ){
17 return path.relative(process.cwd(), file);
18});
19
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070020var files = bowerComponents.concat([
Matteo Scandolo824a7cb2016-04-20 12:24:52 -070021 'node_modules/babel-polyfill/dist/polyfill.js',
Matteo Scandolo320ce2c2016-04-15 12:20:14 -070022 'xosHelpers/src/**/*.module.js',
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070023 'xosHelpers/src/**/*.js',
Matteo Scandolo2b38f622016-05-04 17:22:45 -070024 `xosHelpers/spec/**/${testFiles}.test.js`
Matteo Scandoloa8ab5ae2016-05-03 15:45:28 -070025 // 'xosHelpers/spec/ui/smart-pie.test.js'
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070026]);
27
Matteo Scandolof0830892015-11-05 11:58:53 +010028module.exports = function(config) {
29/*eslint-enable*/
30 config.set({
31
32 // base path that will be used to resolve all patterns (eg. files, exclude)
33 basePath: '',
34
35
36 // frameworks to use
37 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
38 frameworks: ['jasmine'],
39
40
41 // list of files / patterns to load in the browser
Matteo Scandolof5ab3ff2016-03-24 14:07:49 -070042 files: files,
Matteo Scandolof0830892015-11-05 11:58:53 +010043
44
45 // list of files to exclude
46 exclude: [
47 ],
48
49
50 // preprocess matching files before serving them to the browser
51 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
52 preprocessors: {
Matteo Scandoloa7e64fd2016-04-14 14:59:09 -070053 'xosHelpers/**/*.js': ['babel'],
Matteo Scandolof0830892015-11-05 11:58:53 +010054 },
55
Matteo Scandolo89b179c2016-03-24 11:38:50 -070056 babelPreprocessor: {
57 options: {
58 presets: ['es2015'],
Matteo Scandolo5fe58df2016-04-26 16:34:56 -070059 sourceMap: 'both'
Matteo Scandolo89b179c2016-03-24 11:38:50 -070060 },
61 filename: function (file) {
62 return file.originalPath;
63 },
Matteo Scandolof0830892015-11-05 11:58:53 +010064 },
65
Matteo Scandolo89b179c2016-03-24 11:38:50 -070066 //ngHtml2JsPreprocessor: {
67 // 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)
68 // moduleName: 'templates' // define the template module name
69 //},
70
Matteo Scandolof0830892015-11-05 11:58:53 +010071 // test results reporter to use
72 // possible values: 'dots', 'progress'
73 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
74 reporters: ['mocha'],
75
76
77 // web server port
78 port: 9876,
79
80
81 // enable / disable colors in the output (reporters and logs)
82 colors: true,
83
84
85 // level of logging
86 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Matteo Scandolo3a55ad62016-04-26 10:10:54 -070087 logLevel: config.LOG_INFO,
Matteo Scandolof0830892015-11-05 11:58:53 +010088
89
90 // enable / disable watching file and executing tests whenever any file changes
91 autoWatch: true,
92
93
94 // start these browsers
95 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandolo5fe58df2016-04-26 16:34:56 -070096 browsers: [
97 'PhantomJS',
Matteo Scandolo2b38f622016-05-04 17:22:45 -070098 // 'Chrome'
Matteo Scandolo5fe58df2016-04-26 16:34:56 -070099 ],
Matteo Scandolof0830892015-11-05 11:58:53 +0100100
101
102 // Continuous Integration mode
103 // if true, Karma captures browsers, runs the tests and exits
104 singleRun: false
105 });
106};