diff --git a/Gruntfile.js b/Gruntfile.js index e09c8567f822c7da02123d1480d8ae7b78060c6c..fc2c6190e4fd1b9638f995ffc4ff8d05378d1004 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,7 +5,7 @@ module.exports = function (grunt) { 'use strict'; - var specRunner = require('./spec_runner'); + var specRunner = require('./dev/tests/js/framework/spec_runner'); specRunner.init(grunt); // Time how long tasks take. Can help when optimizing build times diff --git a/dev/tests/js/framework/spec_runner.js b/dev/tests/js/framework/dev/tests/js/framework/spec_runner.js similarity index 91% rename from dev/tests/js/framework/spec_runner.js rename to dev/tests/js/framework/dev/tests/js/framework/spec_runner.js index 95b01354ebe4794c03dbf298211eda0990c11ded..e8d1f381fd6faf70d9a5c68d58612b4bb5c8cc6e 100644 --- a/dev/tests/js/framework/spec_runner.js +++ b/dev/tests/js/framework/dev/tests/js/framework/spec_runner.js @@ -24,7 +24,7 @@ module.exports.init = function (grunt) { * @return {Boolean} */ function exists(path) { - return fs.existsSync(path); + return fs.existsSync(__dirname + path); } /** @@ -65,7 +65,7 @@ module.exports.init = function (grunt) { app.use(function (req, res, next) { var url = req.url, match = url.match(/^\/([A-Z][^\/]+)_(\w+)\/(.+)$/), - app, + vendor, module, path, getModuleUrl, @@ -80,7 +80,7 @@ module.exports.init = function (grunt) { return [ '/app/design', area, - app, + vendor, theme ].join('/'); } @@ -97,7 +97,7 @@ module.exports.init = function (grunt) { } if (match !== null) { - app = match[1]; + vendor = match[1]; module = match[2]; path = match[3]; @@ -111,10 +111,10 @@ module.exports.init = function (grunt) { getModuleUrl = function (shared) { return [ '/app/code', - app, + vendor, module, 'view', - shared ? share : area, + !!shared ? share : area, 'web', path ].join('/'); @@ -128,13 +128,16 @@ module.exports.init = function (grunt) { getThemeUrl = function () { return [ themeRoot(), - app + '_' + module, + vendor + '_' + module, 'web', path ].join('/'); }; - url = exists(url = getThemeUrl()) ? url : getModuleUrl(true); + url = exists(url = getThemeUrl()) ? + url : + exists(url = getModuleUrl()) ? + url : getModuleUrl(true); } else if (canModify(url)) { url = (exists(url = lib(true)) ? url : lib()) + req.url;