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