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