Skip to content

Commit f75077b

Browse files
committed
MAGETWO-32485: Merge initialization of all components on body element to one initialization file
- Fixes with pathes in spec_runner
1 parent beb16d7 commit f75077b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module.exports = function (grunt) {
66
'use strict';
77

8-
var specRunner = require('./spec_runner');
8+
var specRunner = require('./dev/tests/js/framework/spec_runner');
99
specRunner.init(grunt);
1010

1111
// Time how long tasks take. Can help when optimizing build times

dev/tests/js/framework/spec_runner.js renamed to dev/tests/js/framework/dev/tests/js/framework/spec_runner.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports.init = function (grunt) {
2424
* @return {Boolean}
2525
*/
2626
function exists(path) {
27-
return fs.existsSync(path);
27+
return fs.existsSync(__dirname + path);
2828
}
2929

3030
/**
@@ -65,7 +65,7 @@ module.exports.init = function (grunt) {
6565
app.use(function (req, res, next) {
6666
var url = req.url,
6767
match = url.match(/^\/([A-Z][^\/]+)_(\w+)\/(.+)$/),
68-
app,
68+
vendor,
6969
module,
7070
path,
7171
getModuleUrl,
@@ -80,7 +80,7 @@ module.exports.init = function (grunt) {
8080
return [
8181
'/app/design',
8282
area,
83-
app,
83+
vendor,
8484
theme
8585
].join('/');
8686
}
@@ -97,7 +97,7 @@ module.exports.init = function (grunt) {
9797
}
9898

9999
if (match !== null) {
100-
app = match[1];
100+
vendor = match[1];
101101
module = match[2];
102102
path = match[3];
103103

@@ -111,10 +111,10 @@ module.exports.init = function (grunt) {
111111
getModuleUrl = function (shared) {
112112
return [
113113
'/app/code',
114-
app,
114+
vendor,
115115
module,
116116
'view',
117-
shared ? share : area,
117+
!!shared ? share : area,
118118
'web',
119119
path
120120
].join('/');
@@ -128,13 +128,16 @@ module.exports.init = function (grunt) {
128128
getThemeUrl = function () {
129129
return [
130130
themeRoot(),
131-
app + '_' + module,
131+
vendor + '_' + module,
132132
'web',
133133
path
134134
].join('/');
135135
};
136136

137-
url = exists(url = getThemeUrl()) ? url : getModuleUrl(true);
137+
url = exists(url = getThemeUrl()) ?
138+
url :
139+
exists(url = getModuleUrl()) ?
140+
url : getModuleUrl(true);
138141

139142
} else if (canModify(url)) {
140143
url = (exists(url = lib(true)) ? url : lib()) + req.url;

0 commit comments

Comments
 (0)