Matteo Scandolo | 812aa5a | 2016-04-19 18:12:45 -0700 | [diff] [blame] | 1 | // Karma configuration |
| 2 | |
| 3 | module.exports = function(config) { |
| 4 | config.set({ |
| 5 | |
| 6 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 7 | // the path is relative to this (karma.conf.js) file |
| 8 | basePath: '', |
| 9 | |
| 10 | |
| 11 | // frameworks to use |
| 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 13 | frameworks: ['jasmine'], |
| 14 | |
| 15 | |
| 16 | // list of files / patterns to load in the browser |
| 17 | files: [ |
| 18 | // library code... |
| 19 | '../tp/angular.js', |
| 20 | '../tp/angular-mocks.js', |
| 21 | '../tp/angular-route.js', |
| 22 | '../tp/angular-cookies.js', |
| 23 | '../tp/d3.js', |
| 24 | '../tp/topojson.v1.min.js', |
| 25 | |
| 26 | // production code... |
| 27 | // make sure modules are defined first... |
| 28 | '../onos.js', |
| 29 | |
| 30 | '../app/fw/util/util.js', |
| 31 | '../app/fw/svg/svg.js', |
| 32 | '../app/fw/remote/remote.js', |
| 33 | '../app/fw/widget/widget.js', |
| 34 | '../app/fw/layer/layer.js', |
| 35 | |
| 36 | '../app/view/topo/topo.js', |
| 37 | |
| 38 | // now load services etc. that augment the modules |
| 39 | '../app/**/*.js', |
| 40 | |
| 41 | // unit test code... |
| 42 | 'app/*-spec.js', |
Matteo Scandolo | 231c754 | 2016-05-20 11:13:11 -0700 | [diff] [blame] | 43 | 'app/**/*-spec.js', |
| 44 | |
| 45 | // server mock |
| 46 | './server.mock.js' |
Matteo Scandolo | 812aa5a | 2016-04-19 18:12:45 -0700 | [diff] [blame] | 47 | ], |
| 48 | |
| 49 | |
| 50 | // list of files to exclude |
| 51 | exclude: [ |
| 52 | ], |
| 53 | |
| 54 | |
| 55 | // preprocess matching files before serving them to the browser |
| 56 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 57 | preprocessors: { |
| 58 | }, |
| 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_DISABLE, |
| 78 | |
| 79 | |
| 80 | // enable / disable watching file and executing tests whenever any file changes |
| 81 | autoWatch: false, |
| 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: true |
| 92 | }); |
| 93 | }; |