Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 1 | // 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*/ |
| 7 | var wiredep = require('wiredep'); |
| 8 | var path = require('path'); |
| 9 | |
| 10 | var bowerComponents = wiredep({devDependencies: true})[ 'js' ].map(function( file ){ |
| 11 | return path.relative(process.cwd(), file); |
| 12 | }); |
| 13 | |
Matteo Scandolo | f5ab3ff | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 14 | var files = bowerComponents.concat([ |
Matteo Scandolo | 824a7cb | 2016-04-20 12:24:52 -0700 | [diff] [blame] | 15 | 'node_modules/babel-polyfill/dist/polyfill.js', |
Matteo Scandolo | 320ce2c | 2016-04-15 12:20:14 -0700 | [diff] [blame] | 16 | 'xosHelpers/src/**/*.module.js', |
Matteo Scandolo | f5ab3ff | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 17 | 'xosHelpers/src/**/*.js', |
| 18 | 'xosHelpers/spec/**/*.test.js' |
Matteo Scandolo | a8ab5ae | 2016-05-03 15:45:28 -0700 | [diff] [blame] | 19 | // 'xosHelpers/spec/ui/smart-pie.test.js' |
Matteo Scandolo | f5ab3ff | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 20 | ]); |
| 21 | |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 22 | module.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 Scandolo | f5ab3ff | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 36 | files: files, |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 37 | |
| 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 Scandolo | a7e64fd | 2016-04-14 14:59:09 -0700 | [diff] [blame] | 47 | 'xosHelpers/**/*.js': ['babel'], |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 48 | }, |
| 49 | |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 50 | babelPreprocessor: { |
| 51 | options: { |
| 52 | presets: ['es2015'], |
Matteo Scandolo | 5fe58df | 2016-04-26 16:34:56 -0700 | [diff] [blame] | 53 | sourceMap: 'both' |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 54 | }, |
| 55 | filename: function (file) { |
| 56 | return file.originalPath; |
| 57 | }, |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 58 | }, |
| 59 | |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 60 | //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 Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 65 | // 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 Scandolo | 3a55ad6 | 2016-04-26 10:10:54 -0700 | [diff] [blame] | 81 | logLevel: config.LOG_INFO, |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 82 | |
| 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 Scandolo | 5fe58df | 2016-04-26 16:34:56 -0700 | [diff] [blame] | 90 | browsers: [ |
| 91 | 'PhantomJS', |
Matteo Scandolo | 2e804cb | 2016-04-27 16:29:33 -0700 | [diff] [blame] | 92 | 'Chrome' |
Matteo Scandolo | 5fe58df | 2016-04-26 16:34:56 -0700 | [diff] [blame] | 93 | ], |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 94 | |
| 95 | |
| 96 | // Continuous Integration mode |
| 97 | // if true, Karma captures browsers, runs the tests and exits |
| 98 | singleRun: false |
| 99 | }); |
| 100 | }; |