Matteo Scandolo | 57483dd | 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 | 061094b | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 14 | var files = bowerComponents.concat([ |
Matteo Scandolo | cc6954e | 2016-04-15 12:20:14 -0700 | [diff] [blame] | 15 | 'xosHelpers/src/**/*.module.js', |
Matteo Scandolo | 061094b | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 16 | 'xosHelpers/src/**/*.js', |
| 17 | 'xosHelpers/spec/**/*.test.js' |
| 18 | ]); |
| 19 | |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 20 | module.exports = function(config) { |
| 21 | /*eslint-enable*/ |
| 22 | config.set({ |
| 23 | |
| 24 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 25 | basePath: '', |
| 26 | |
| 27 | |
| 28 | // frameworks to use |
| 29 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 30 | frameworks: ['jasmine'], |
| 31 | |
| 32 | |
| 33 | // list of files / patterns to load in the browser |
Matteo Scandolo | 061094b | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 34 | files: files, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 35 | |
| 36 | |
| 37 | // list of files to exclude |
| 38 | exclude: [ |
| 39 | ], |
| 40 | |
| 41 | |
| 42 | // preprocess matching files before serving them to the browser |
| 43 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 44 | preprocessors: { |
Matteo Scandolo | 9e6c6fc | 2016-04-14 14:59:09 -0700 | [diff] [blame] | 45 | 'xosHelpers/**/*.js': ['babel'], |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 46 | }, |
| 47 | |
Matteo Scandolo | 8420f62 | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 48 | babelPreprocessor: { |
| 49 | options: { |
| 50 | presets: ['es2015'], |
| 51 | sourceMap: 'inline' |
| 52 | }, |
| 53 | filename: function (file) { |
| 54 | return file.originalPath; |
| 55 | }, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 56 | }, |
| 57 | |
Matteo Scandolo | 8420f62 | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 58 | //ngHtml2JsPreprocessor: { |
| 59 | // 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) |
| 60 | // moduleName: 'templates' // define the template module name |
| 61 | //}, |
| 62 | |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 63 | // test results reporter to use |
| 64 | // possible values: 'dots', 'progress' |
| 65 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
| 66 | reporters: ['mocha'], |
| 67 | |
| 68 | |
| 69 | // web server port |
| 70 | port: 9876, |
| 71 | |
| 72 | |
| 73 | // enable / disable colors in the output (reporters and logs) |
| 74 | colors: true, |
| 75 | |
| 76 | |
| 77 | // level of logging |
| 78 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
Matteo Scandolo | 7dea243 | 2016-03-24 15:11:29 -0700 | [diff] [blame] | 79 | logLevel: config.LOG_ERROR, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 80 | |
| 81 | |
| 82 | // enable / disable watching file and executing tests whenever any file changes |
| 83 | autoWatch: true, |
| 84 | |
| 85 | |
| 86 | // start these browsers |
| 87 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
Matteo Scandolo | a6a9e61 | 2016-04-14 16:52:13 -0700 | [diff] [blame] | 88 | browsers: ['PhantomJS'], |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 89 | |
| 90 | |
| 91 | // Continuous Integration mode |
| 92 | // if true, Karma captures browsers, runs the tests and exits |
| 93 | singleRun: false |
| 94 | }); |
| 95 | }; |