|
| 1 | +module.exports = function(config){ |
| 2 | + var browsers, basePath, coverageReporter; |
| 3 | + |
| 4 | + if(process.env.TRAVIS){ |
| 5 | + browsers = ["Firefox"]; |
| 6 | + basePath = '/home/travis/virtualenv/python2.7/src/opal/opal/static/js'; |
| 7 | + coverageReporter = { |
| 8 | + type: 'lcovonly', // lcov or lcovonly are required for generating lcov.info files |
| 9 | + dir: __dirname + '/../coverage/', |
| 10 | + }; |
| 11 | + } |
| 12 | + else{ |
| 13 | + browsers = ['PhantomJS']; |
| 14 | + basePath = '../../opal/opal/static/js'; |
| 15 | + coverageReporter = { |
| 16 | + type : 'html', |
| 17 | + dir : __dirname + '/../htmlcov/js/' |
| 18 | + }; |
| 19 | + } |
| 20 | + |
| 21 | + var preprocessors = {}; |
| 22 | + preprocessors[__dirname + '/../elcid/assets/js/elcid/*'] = 'coverage'; |
| 23 | + preprocessors[__dirname + '/../elcid/assets/js/elcid/controllers/*'] = 'coverage'; |
| 24 | + preprocessors[__dirname + '/../elcid/assets/js/elcid/services/*'] = 'coverage'; |
| 25 | + preprocessors[__dirname + '/../elcid/assets/js/elcid/services/records/*'] = 'coverage'; |
| 26 | + preprocessors[__dirname + '/../opat/static/js/opat/controllers/*'] = 'coverage'; |
| 27 | + preprocessors[__dirname + '/../research/static/js/research/controllers/*'] = 'coverage'; |
| 28 | + preprocessors[__dirname + '/../walkin/static/js/walkin/controllers/*'] = 'coverage'; |
| 29 | + |
| 30 | + config.set({ |
| 31 | + frameworks: ['jasmine'], |
| 32 | + browsers: browsers, |
| 33 | + basePath: basePath, |
| 34 | + |
| 35 | + files: [ |
| 36 | + //JASMINE, |
| 37 | + //JASMINE_ADAPTER, |
| 38 | + "lib/bower_components/angular/angular.js", |
| 39 | + "lib/bower_components/angular-route/angular-route.js", |
| 40 | + "lib/bower_components/angular-resource/angular-resource.js", |
| 41 | + "lib/bower_components/angular-cookies/angular-cookies.js", |
| 42 | + "lib/bower_components/angular-mocks/angular-mocks.js", |
| 43 | + |
| 44 | + 'lib/angular-ui-utils-0.1.0/ui-utils.js', |
| 45 | + 'lib/angular-ui-bootstrap-0.10.0/ui-bootstrap-tpls.js', |
| 46 | + 'lib/angular-strap-2.3.1/angular-strap.js', |
| 47 | + 'lib/angular-strap-2.3.1/modules/compiler.js', |
| 48 | + 'lib/angular-strap-2.3.1/modules/tooltip.js', |
| 49 | + 'lib/angular-strap-2.3.1/modules/tooltip.tpl.js', |
| 50 | + 'lib/angular-strap-2.3.1/modules/dimensions.js', |
| 51 | + 'lib/angular-strap-2.3.1/modules/parse-options.js', |
| 52 | + 'lib/angular-strap-2.3.1/modules/date-parser.js', |
| 53 | + 'lib/angular-strap-2.3.1/modules/datepicker.js', |
| 54 | + 'lib/angular-strap-2.3.1/modules/datepicker.tpl.js', |
| 55 | + 'lib/angular-strap-2.3.1/modules/timepicker.js', |
| 56 | + 'lib/angular-strap-2.3.1/modules/timepicker.tpl.js', |
| 57 | + 'lib/angular-strap-2.3.1/modules/typeahead.js', |
| 58 | + 'lib/angular-strap-2.3.1/modules/typeahead.tpl.js', |
| 59 | + "lib/angulartics-0.17.2/angulartics.min.js", |
| 60 | + "lib/angulartics-0.17.2/angulartics-ga.min.js", |
| 61 | + 'lib/ngprogress-lite/ngprogress-lite.js', |
| 62 | + 'lib/jquery-1.11.3/jquery-1.11.3.js', |
| 63 | + 'lib/utils/underscore.js', |
| 64 | + 'lib/utils/showdown.js', |
| 65 | + 'lib/utils/moment.js', |
| 66 | + 'lib/bower_components/angular-growl-v2/build/angular-growl.js', |
| 67 | + 'lib/bower_components/ment.io/dist/mentio.js', |
| 68 | + 'lib/bower_components/ment.io/dist/templates.js', |
| 69 | + 'lib/bower_components/angular-ui-select/dist/select.js', |
| 70 | + "lib/bower_components/angular-local-storage/dist/angular-local-storage.js", |
| 71 | + |
| 72 | + 'opal/utils.js', |
| 73 | + 'opal/directives.js', |
| 74 | + 'opal/filters.js', |
| 75 | + 'opal/services_module.js', |
| 76 | + 'opal/services/*.js', |
| 77 | + 'opal/controllers_module.js', |
| 78 | + 'opal/controllers/*.js', |
| 79 | + 'opal/app.js', |
| 80 | + '../../core/search/static/js/search/controllers/*', |
| 81 | + '../../core/search/static/js/search/services/*', |
| 82 | + |
| 83 | + |
| 84 | + // Our application |
| 85 | + |
| 86 | + __dirname + '/../elcid/assets/js/elcid/*.js', |
| 87 | + __dirname + '/../elcid/assets/js/elcid/controllers/*.js', |
| 88 | + __dirname + '/../elcid/assets/js/elcid/services/*.js', |
| 89 | + __dirname + '/../elcid/assets/js/elcid/services/records/*.js', |
| 90 | + __dirname + '/../opat/static/js/opat/controllers/*.js', |
| 91 | + __dirname + '/../research/static/js/research/controllers/*.js', |
| 92 | + __dirname + '/../walkin/static/js/walkin/controllers/*.js', |
| 93 | + |
| 94 | + |
| 95 | + // The tests |
| 96 | + __dirname + '/../elcid/assets/js/elcidtest/*.js', |
| 97 | + __dirname + '/../opat/static/js/test/*.js', |
| 98 | + __dirname + '/../research/static/js/test/*.js', |
| 99 | + __dirname + '/../walkin/static/js/walkintest/*.js', |
| 100 | + ], |
| 101 | + |
| 102 | + preprocessors: preprocessors, |
| 103 | + |
| 104 | + reporters: ['progress', 'coverage'], |
| 105 | + autoWatch: true, |
| 106 | + |
| 107 | + coverageReporter: coverageReporter, |
| 108 | + |
| 109 | + // Stolen from http://oligofren.wordpress.com/2014/05/27/running-karma-tests-on-browserstack/ |
| 110 | + browserDisconnectTimeout : 10000, // default 2000 |
| 111 | + browserDisconnectTolerance : 1, // default 0 |
| 112 | + browserNoActivityTimeout : 4*60*1000, //default 10000 |
| 113 | + captureTimeout : 4*60*1000, //default 60000 |
| 114 | + }); |
| 115 | +} |
0 commit comments