Matteo Scandolo | d2044a4 | 2017-08-07 16:08:28 -0700 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 19 | // Karma configuration |
| 20 | // Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC) |
| 21 | |
| 22 | /* eslint indent: [2,2], quotes: [2, "single"]*/ |
| 23 | |
| 24 | /*eslint-disable*/ |
| 25 | var wiredep = require('wiredep'); |
| 26 | var path = require('path'); |
| 27 | |
| 28 | var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){ |
| 29 | return path.relative(process.cwd(), file); |
| 30 | }); |
Matteo Scandolo | 54bc5f7 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 31 | |
Matteo Scandolo | 195dde9 | 2016-07-25 16:43:16 -0700 | [diff] [blame] | 32 | |
Matteo Scandolo | 1b9ffac | 2015-12-14 17:36:09 -0800 | [diff] [blame] | 33 | module.exports = function(config) { |
Matteo Scandolo | 54bc5f7 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 34 | /*eslint-enable*/ |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 35 | config.set({ |
| 36 | |
| 37 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 38 | basePath: '', |
| 39 | |
| 40 | |
| 41 | // frameworks to use |
| 42 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 43 | frameworks: ['jasmine'], |
| 44 | |
| 45 | |
| 46 | // list of files / patterns to load in the browser |
Matteo Scandolo | 195dde9 | 2016-07-25 16:43:16 -0700 | [diff] [blame] | 47 | files: ['./src/vendor/ng-xos-lib/dist/ngXosVendor.min.js'] |
| 48 | .concat(bowerComponents).concat([ |
| 49 | './src/vendor/ng-xos-lib/dist/ngXosHelpers.min.js', |
Matteo Scandolo | 8420f62 | 2016-03-24 11:38:50 -0700 | [diff] [blame] | 50 | 'src/js/main.js', |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 51 | 'src/js/**/*.js', |
| 52 | 'spec/**/*.mock.js', |
| 53 | 'spec/**/*.test.js', |
| 54 | 'src/**/*.html' |
| 55 | ]), |
| 56 | |
| 57 | |
| 58 | // list of files to exclude |
| 59 | exclude: [ |
| 60 | ], |
| 61 | |
| 62 | |
| 63 | // preprocess matching files before serving them to the browser |
| 64 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 65 | preprocessors: { |
| 66 | 'src/js/**/*.js': ['babel'], |
Matteo Scandolo | 54bc5f7 | 2016-05-18 14:06:45 -0700 | [diff] [blame] | 67 | 'spec/**/*.test.js': ['babel'], |
| 68 | 'spec/**/*.mock.js': ['babel'], |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 69 | 'src/**/*.html': ['ng-html2js'] |
| 70 | }, |
| 71 | |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 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 |
| 80 | reporters: ['mocha'], |
| 81 | |
| 82 | |
| 83 | // web server port |
| 84 | port: 9876, |
| 85 | |
| 86 | |
| 87 | // enable / disable colors in the output (reporters and logs) |
| 88 | colors: true, |
| 89 | |
| 90 | |
| 91 | // level of logging |
| 92 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 93 | logLevel: config.LOG_INFO, |
| 94 | |
| 95 | |
| 96 | // enable / disable watching file and executing tests whenever any file changes |
| 97 | autoWatch: true, |
| 98 | |
| 99 | |
| 100 | // start these browsers |
| 101 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
| 102 | browsers: ['PhantomJS'], |
| 103 | |
| 104 | |
| 105 | // Continuous Integration mode |
| 106 | // if true, Karma captures browsers, runs the tests and exits |
| 107 | singleRun: false |
| 108 | }); |
| 109 | }; |