blob: 8e9cd39ffb877e2920ac4d73d5a3bc7f65625bb2 [file] [log] [blame]
Simon Hunt449630f2014-12-09 11:40:00 -08001// Karma configuration
Simon Hunt449630f2014-12-09 11:40:00 -08002
3module.exports = function(config) {
4 config.set({
5
6 // base path that will be used to resolve all patterns (eg. files, exclude)
Simon Hunt5d12dc22015-01-05 16:56:22 -08007 // the path is relative to this (karma.conf.js) file
Simon Hunt449630f2014-12-09 11:40:00 -08008 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: [
Simon Huntf3069722014-12-16 18:15:37 -080018 // library code...
19 '../tp/angular.js',
20 '../tp/angular-mocks.js',
Simon Hunt5d12dc22015-01-05 16:56:22 -080021 '../tp/angular-route.js',
Simon Huntc7ae7952015-04-08 18:59:27 -070022 '../tp/angular-cookies.js',
Simon Huntf3069722014-12-16 18:15:37 -080023 '../tp/d3.js',
24 '../tp/topojson.v1.min.js',
Simon Huntf3069722014-12-16 18:15:37 -080025
26 // production code...
Simon Huntdc6362a2014-12-18 19:55:23 -080027 // make sure modules are defined first...
Simon Hunt7c7dd3e2015-02-27 11:42:18 -080028 '../onos.js',
Simon Hunt737c89f2015-01-28 12:23:19 -080029
Simon Huntdc6362a2014-12-18 19:55:23 -080030 '../app/fw/util/util.js',
Simon Hunt7ac7be92015-01-06 10:47:56 -080031 '../app/fw/svg/svg.js',
Simon Hunte6720442015-01-15 12:21:06 -080032 '../app/fw/remote/remote.js',
Bri Prebilic Cole093739a2015-01-23 10:22:50 -080033 '../app/fw/widget/widget.js',
Simon Hunt988934e2015-01-23 11:49:24 -080034 '../app/fw/layer/layer.js',
Simon Hunt737c89f2015-01-28 12:23:19 -080035
36 '../app/view/topo/topo.js',
37
Simon Huntdc6362a2014-12-18 19:55:23 -080038 // now load services etc. that augment the modules
39 '../app/**/*.js',
Simon Huntf3069722014-12-16 18:15:37 -080040
41 // unit test code...
Simon Huntdc6362a2014-12-18 19:55:23 -080042 'app/*-spec.js',
Matteo Scandolo231c7542016-05-20 11:13:11 -070043 'app/**/*-spec.js',
44
45 // server mock
46 './server.mock.js'
Simon Hunt449630f2014-12-09 11:40:00 -080047 ],
48
49
50 // list of files to exclude
51 exclude: [
Steven Burrows72a354f2016-10-10 15:57:39 -050052 '../app/view/topo2/node_modules/**/*'
Simon Hunt449630f2014-12-09 11:40:00 -080053 ],
54
55
56 // preprocess matching files before serving them to the browser
57 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
58 preprocessors: {
Steven Burrowsdb3be6f2017-07-11 22:44:31 +010059 '../app/**/*.js': 'coverage'
Simon Hunt449630f2014-12-09 11:40:00 -080060 },
61
62
63 // test results reporter to use
64 // possible values: 'dots', 'progress'
65 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
Steven Burrowsdb3be6f2017-07-11 22:44:31 +010066 reporters: ['mocha', 'coverage'],
67 coverageReport: {
68 type: 'html',
69 dir : 'coverage/'
70 },
Simon Hunt449630f2014-12-09 11:40:00 -080071
72 // web server port
73 port: 9876,
74
75
76 // enable / disable colors in the output (reporters and logs)
77 colors: true,
78
79
80 // level of logging
81 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
82 logLevel: config.LOG_INFO,
83
84
85 // enable / disable watching file and executing tests whenever any file changes
86 autoWatch: true,
87
88
89 // start these browsers
90 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
Matteo Scandolo6602db82016-04-19 18:12:45 -070091 browsers: ['PhantomJS'],
Simon Hunt449630f2014-12-09 11:40:00 -080092
93
94 // Continuous Integration mode
95 // if true, Karma captures browsers, runs the tests and exits
96 singleRun: false
97 });
98};