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 | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 14 | console.log('bower', bowerComponents) |
| 15 | |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 16 | module.exports = function(config) { |
| 17 | /*eslint-enable*/ |
| 18 | config.set({ |
| 19 | |
| 20 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 21 | basePath: '', |
| 22 | |
| 23 | |
| 24 | // frameworks to use |
| 25 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 26 | frameworks: ['jasmine'], |
| 27 | |
| 28 | |
| 29 | // list of files / patterns to load in the browser |
| 30 | files: bowerComponents.concat([ |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 31 | //'./api/**/*.js', |
| 32 | './xosHelpers/src/*.module.js', |
| 33 | //'./xosHelpers/src/**/*.js', |
| 34 | './xosHelpers/spec/**/*.test.js' |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 35 | ]), |
| 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 | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 46 | '**/*.test.js': ['babel'] |
Matteo Scandolo | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 47 | }, |
| 48 | |
Matteo Scandolo | 89b179c | 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 | f083089 | 2015-11-05 11:58:53 +0100 | [diff] [blame] | 57 | }, |
| 58 | |
Matteo Scandolo | 89b179c | 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 | f083089 | 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 | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 80 | logLevel: config.LOG_INFO, |
Matteo Scandolo | f083089 | 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 |
| 89 | browsers: ['PhantomJS'], |
| 90 | |
| 91 | |
| 92 | // Continuous Integration mode |
| 93 | // if true, Karma captures browsers, runs the tests and exits |
| 94 | singleRun: false |
| 95 | }); |
| 96 | }; |