diff --git a/horizon/karma.conf.js b/horizon/karma.conf.js index 8cef1246e9..fabc3a4d58 100644 --- a/horizon/karma.conf.js +++ b/horizon/karma.conf.js @@ -1,23 +1,24 @@ +'use strict'; var fs = require('fs'); var path = require('path'); -module.exports = function(config){ +module.exports = function(config) { var xstaticPath; - var base_paths = [ + var basePaths = [ './.venv', './.tox/py27' ] - for( var i = 0; i < base_paths.length; i++) { - var base_path = path.resolve(base_paths[i]); + for (var i = 0; i < basePaths.length; i++) { + var basePath = path.resolve(basePaths[i]); - if( fs.existsSync(base_path) ) { - xstaticPath = base_path + '/lib/python2.7/site-packages/xstatic/pkg/'; + if (fs.existsSync(basePath)) { + xstaticPath = basePath + '/lib/python2.7/site-packages/xstatic/pkg/'; break; } } - if( !xstaticPath) { + if (!xstaticPath) { console.error("xStatic libraries not found, please set up venv"); process.exit(1); } @@ -63,7 +64,6 @@ module.exports = function(config){ xstaticPath + 'spin/data/spin.js', xstaticPath + 'spin/data/spin.jquery.js', - // from jasmine_tests.py; only those that are deps for others 'horizon/js/horizon.js', 'horizon/js/angular/hz.api.module.js', @@ -91,7 +91,7 @@ module.exports = function(config){ xstaticPath + 'magic_search/data/magic_search.js', // TESTS - '**/*.spec.js', + '**/*.spec.js' ], autoWatch : true, diff --git a/openstack_dashboard/karma.conf.js b/openstack_dashboard/karma.conf.js index 005b6aaa22..16d7c28cf2 100644 --- a/openstack_dashboard/karma.conf.js +++ b/openstack_dashboard/karma.conf.js @@ -1,23 +1,24 @@ +'use strict'; var fs = require('fs'); var path = require('path'); -module.exports = function(config){ +module.exports = function(config) { var xstaticPath; - var base_paths = [ + var basePaths = [ './.venv', './.tox/py27' ] - for( var i = 0; i < base_paths.length; i++) { - var base_path = path.resolve(base_paths[i]); + for (var i = 0; i < basePaths.length; i++) { + var basePath = path.resolve(basePaths[i]); - if( fs.existsSync(base_path) ) { - xstaticPath = base_path + '/lib/python2.7/site-packages/xstatic/pkg/'; + if (fs.existsSync(basePath)) { + xstaticPath = basePath + '/lib/python2.7/site-packages/xstatic/pkg/'; break; } } - if( !xstaticPath) { + if (!xstaticPath) { console.error("xStatic libraries not found, please set up venv"); process.exit(1); } @@ -71,7 +72,7 @@ module.exports = function(config){ "dashboard/**/*.js", // Templates. - './**/*.html', + './**/*.html' ], autoWatch : true,