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 | 9f0e5ae | 2016-04-20 12:24:52 -0700 | [diff] [blame] | 15 | 'node_modules/babel-polyfill/dist/polyfill.js', |
Matteo Scandolo | cc6954e | 2016-04-15 12:20:14 -0700 | [diff] [blame] | 16 | 'xosHelpers/src/**/*.module.js', |
Matteo Scandolo | 061094b | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 17 | 'xosHelpers/src/**/*.js', |
| 18 | 'xosHelpers/spec/**/*.test.js' |
| 19 | ]); |
| 20 | |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 21 | module.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 Scandolo | 061094b | 2016-03-24 14:07:49 -0700 | [diff] [blame] | 35 | files: files, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 36 | |
| 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 Scandolo | 9e6c6fc | 2016-04-14 14:59:09 -0700 | [diff] [blame] | 46 | 'xosHelpers/**/*.js': ['babel'], |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 47 | }, |
| 48 | |
Matteo Scandolo | 8420f62 | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 49 | babelPreprocessor: { |
| 50 | options: { |
| 51 | presets: ['es2015'], |
| 52 | sourceMap: 'inline' |
| 53 | }, |
| 54 | filename: function (file) { |
| 55 | return file.originalPath; |
| 56 | }, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 57 | }, |
| 58 | |
Matteo Scandolo | 8420f62 | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 59 | //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 Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 64 | // 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 Scandolo | 7dea243 | 2016-03-24 15:11:29 -0700 | [diff] [blame] | 80 | logLevel: config.LOG_ERROR, |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 81 | |
| 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 Scandolo | a6a9e61 | 2016-04-14 16:52:13 -0700 | [diff] [blame] | 89 | browsers: ['PhantomJS'], |
Matteo Scandolo | 57483dd | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 90 | |
| 91 | |
| 92 | // Continuous Integration mode |
| 93 | // if true, Karma captures browsers, runs the tests and exits |
| 94 | singleRun: false |
| 95 | }); |
| 96 | }; |