Matteo Scandolo | 68c2e72 | 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 | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 13 | /*eslint-enable*/ |
Matteo Scandolo | 1b9ffac | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 14 | module.exports = function(config) { |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 15 | config.set({ |
| 16 | |
| 17 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 18 | basePath: '', |
| 19 | |
| 20 | |
| 21 | // frameworks to use |
| 22 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 23 | frameworks: ['jasmine'], |
| 24 | |
| 25 | |
| 26 | // list of files / patterns to load in the browser |
| 27 | files: bowerComponents.concat([ |
| 28 | 'src/css/**/*.css', |
Matteo Scandolo | 895b30a | 2016-02-02 16:04:31 -0800 | [diff] [blame] | 29 | '../../../xos/core/xoslib/static/js/xosApi.js', |
| 30 | '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js', |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 31 | 'src/js/**/*.js', |
| 32 | 'spec/**/*.mock.js', |
| 33 | 'spec/**/*.test.js', |
| 34 | 'src/**/*.html' |
| 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: { |
| 46 | 'src/js/**/*.js': ['babel'], |
Matteo Scandolo | 1b9ffac | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 47 | 'spec/**/*.js': ['babel'], |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 48 | 'src/**/*.html': ['ng-html2js'] |
| 49 | }, |
| 50 | |
Matteo Scandolo | 1b9ffac | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 51 | babelPreprocessor: { |
| 52 | options: { |
| 53 | presets: ['es2015'], |
| 54 | sourceMap: 'inline' |
| 55 | } |
| 56 | }, |
| 57 | |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [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 | |
| 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 |
| 79 | logLevel: config.LOG_INFO, |
| 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 |
| 88 | browsers: ['PhantomJS'], |
| 89 | |
| 90 | |
| 91 | // Continuous Integration mode |
| 92 | // if true, Karma captures browsers, runs the tests and exits |
| 93 | singleRun: false |
| 94 | }); |
| 95 | }; |