Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 1 | /*eslint-env node */ |
| 2 | (function () { |
| 3 | |
| 4 | 'use strict'; |
| 5 | |
| 6 | // Karma configuration |
| 7 | // Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC) |
| 8 | |
| 9 | const babelPreset = require('babel-preset-es2015'); |
| 10 | |
| 11 | /*eslint-disable*/ |
| 12 | |
| 13 | var files = [ |
| 14 | 'node_modules/babel-polyfill/dist/polyfill.js', |
| 15 | |
| 16 | |
| 17 | // loading jquery (it's used in tests) |
| 18 | `./bower_components/jquery/dist/jquery.js`, |
| 19 | `./bower_components/jasmine-jquery/lib/jasmine-jquery.js`, |
| 20 | |
| 21 | // loading helpers and vendors |
| 22 | `./dist/ngXosVendor.min.js`, |
| 23 | `./dist/xosUiComponents.js`, |
| 24 | |
| 25 | // loading ngMock |
| 26 | `./bower_components/angular-mocks/angular-mocks.js`, |
| 27 | ] |
| 28 | .concat([ |
| 29 | // loading tests |
| 30 | `spec/test_helpers.js`, |
| 31 | `spec/ui/xos.helpers.mock.js`, |
| 32 | 'spec/ui/**/*.test.js' |
| 33 | ]); |
| 34 | |
| 35 | module.exports = function(config) { |
| 36 | /*eslint-enable*/ |
| 37 | config.set({ |
| 38 | |
| 39 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 40 | basePath: '', |
| 41 | |
| 42 | |
| 43 | // frameworks to use |
| 44 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 45 | frameworks: ['jasmine'], |
| 46 | |
| 47 | |
| 48 | // list of files / patterns to load in the browser |
| 49 | files: files, |
| 50 | |
| 51 | |
| 52 | // list of files to exclude |
| 53 | exclude: [ |
| 54 | ], |
| 55 | |
| 56 | |
| 57 | // preprocess matching files before serving them to the browser |
| 58 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 59 | preprocessors: { |
| 60 | './spec/ui/**/*.test.js': ['babel'], |
| 61 | './spec/test_helpers.js': ['babel'], |
| 62 | './spec/ui/xos.helpers.mock.js': ['babel'] |
| 63 | }, |
| 64 | |
| 65 | babelPreprocessor: { |
| 66 | options: { |
| 67 | presets: [babelPreset], |
| 68 | sourceMap: 'inline' |
| 69 | } |
| 70 | }, |
| 71 | |
| 72 | //ngHtml2JsPreprocessor: { |
| 73 | // 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) |
| 74 | // moduleName: 'templates' // define the template module name |
| 75 | //}, |
| 76 | |
| 77 | // test results reporter to use |
| 78 | // possible values: 'dots', 'progress' |
| 79 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
Matteo Scandolo | 0856e65 | 2016-07-22 11:24:22 -0700 | [diff] [blame] | 80 | reporters: ['dots'], |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 81 | |
| 82 | // web server port |
| 83 | port: 9876, |
| 84 | |
| 85 | |
| 86 | // enable / disable colors in the output (reporters and logs) |
| 87 | colors: true, |
| 88 | |
| 89 | |
| 90 | // level of logging |
| 91 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 92 | logLevel: config.LOG_INFO, |
| 93 | |
| 94 | |
| 95 | // enable / disable watching file and executing tests whenever any file changes |
| 96 | autoWatch: false, |
| 97 | |
| 98 | |
| 99 | // start these browsers |
| 100 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
| 101 | browsers: [ |
| 102 | 'PhantomJS', |
| 103 | // 'Chrome' |
| 104 | ], |
| 105 | |
| 106 | |
| 107 | // Continuous Integration mode |
| 108 | // if true, Karma captures browsers, runs the tests and exits |
| 109 | singleRun: true |
| 110 | }); |
| 111 | }; |
| 112 | |
| 113 | })(); |