diff options
author | Pascal Boutin <pboutin@internap.com> | 2017-07-27 10:01:33 -0400 |
---|---|---|
committer | Pascal Boutin <pboutin@internap.com> | 2017-07-27 10:01:33 -0400 |
commit | 0dc5a8230e86495df7fb153913929425be500f38 (patch) | |
tree | 8b51d53c69e0beb5f81546b0712026995b7a6d81 /openstack_dashboard/karma.conf.js | |
parent | e5339c35d0c979cbc40479c12aaa1bbc0ff36cec (diff) | |
download | horizon-0dc5a8230e86495df7fb153913929425be500f38.tar.gz |
Makes the xstatic files lookup dynamic in the tests
This change makes it so the tests will look for the actual
python folder where the xstatic files are located instead
of looking only for a python2.7/ folder.
Change-Id: Ib2a56475b79b002085922ab752038239635fb9a5
Closes-bug: #1706980
Diffstat (limited to 'openstack_dashboard/karma.conf.js')
-rw-r--r-- | openstack_dashboard/karma.conf.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openstack_dashboard/karma.conf.js b/openstack_dashboard/karma.conf.js index ed8acf985..28e7ee9ce 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: { |