Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [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 | }); |
Matteo Scandolo | d24b871 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 13 | |
Matteo Scandolo | 48d890f | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 14 | module.exports = function(config) { |
Matteo Scandolo | d24b871 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 15 | /*eslint-enable*/ |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 16 | config.set({ |
| 17 | |
| 18 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 19 | basePath: '', |
| 20 | |
| 21 | |
| 22 | // frameworks to use |
| 23 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 24 | frameworks: ['jasmine'], |
| 25 | |
| 26 | |
| 27 | // list of files / patterns to load in the browser |
| 28 | files: bowerComponents.concat([ |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 29 | '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js', |
Matteo Scandolo | 10e6173 | 2016-02-02 16:04:31 -0800 | [diff] [blame] | 30 | '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js', |
Matteo Scandolo | 89b179c | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 31 | 'src/js/main.js', |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 32 | 'src/js/**/*.js', |
| 33 | 'spec/**/*.mock.js', |
| 34 | 'spec/**/*.test.js', |
| 35 | 'src/**/*.html' |
| 36 | ]), |
| 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: { |
| 47 | 'src/js/**/*.js': ['babel'], |
Matteo Scandolo | d24b871 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 48 | 'spec/**/*.test.js': ['babel'], |
| 49 | 'spec/**/*.mock.js': ['babel'], |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 50 | 'src/**/*.html': ['ng-html2js'] |
| 51 | }, |
| 52 | |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 53 | ngHtml2JsPreprocessor: { |
| 54 | 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) |
| 55 | moduleName: 'templates' // define the template module name |
| 56 | }, |
| 57 | |
| 58 | // test results reporter to use |
| 59 | // possible values: 'dots', 'progress' |
| 60 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
| 61 | reporters: ['mocha'], |
| 62 | |
| 63 | |
| 64 | // web server port |
| 65 | port: 9876, |
| 66 | |
| 67 | |
| 68 | // enable / disable colors in the output (reporters and logs) |
| 69 | colors: true, |
| 70 | |
| 71 | |
| 72 | // level of logging |
| 73 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 74 | logLevel: config.LOG_INFO, |
| 75 | |
| 76 | |
| 77 | // enable / disable watching file and executing tests whenever any file changes |
| 78 | autoWatch: true, |
| 79 | |
| 80 | |
| 81 | // start these browsers |
| 82 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
| 83 | browsers: ['PhantomJS'], |
| 84 | |
| 85 | |
| 86 | // Continuous Integration mode |
| 87 | // if true, Karma captures browsers, runs the tests and exits |
| 88 | singleRun: false |
| 89 | }); |
| 90 | }; |