diff --git a/horizon/karma.conf.js b/horizon/karma.conf.js index e3cc7d3baa..495495dc23 100644 --- a/horizon/karma.conf.js +++ b/horizon/karma.conf.js @@ -22,14 +22,15 @@ var path = require('path'); module.exports = function (config) { var xstaticPath = path.resolve('./.tox/npm'); - if (fs.existsSync(xstaticPath)) { - xstaticPath += '/lib/python2.7/site-packages/xstatic/pkg/'; - } - if (!xstaticPath) { console.error('xStatic libraries not found, please run `tox -e npm`'); process.exit(1); } + xstaticPath += '/lib/'; + xstaticPath += fs.readdirSync(xstaticPath).find(function(directory) { + return directory.indexOf('python') === 0; + }); + xstaticPath += '/site-packages/xstatic/pkg/'; config.set({ preprocessors: { diff --git a/openstack_dashboard/karma.conf.js b/openstack_dashboard/karma.conf.js index ed8acf985f..28e7ee9ce7 100644 --- a/openstack_dashboard/karma.conf.js +++ b/openstack_dashboard/karma.conf.js @@ -22,14 +22,15 @@ var path = require('path'); module.exports = function (config) { var xstaticPath = path.resolve('./.tox/npm'); - if (fs.existsSync(xstaticPath)) { - xstaticPath += '/lib/python2.7/site-packages/xstatic/pkg/'; - } - if (!xstaticPath) { console.error('xStatic libraries not found, please run `tox -e npm`'); process.exit(1); } + xstaticPath += '/lib/'; + xstaticPath += fs.readdirSync(xstaticPath).find(function(directory) { + return directory.indexOf('python') === 0; + }); + xstaticPath += '/site-packages/xstatic/pkg/'; config.set({ preprocessors: {