Skip to content
Snippets Groups Projects
Commit cbe29b04 authored by Volodymyr Zaets's avatar Volodymyr Zaets Committed by GitHub
Browse files

Merge pull request #525 from magento-south/jsunit

Bug
- MAGETWO-59870 Grunt spec task runs on incorrect ports for several areas
parents 8ee63a1f 4ab99cd2
Branches
Tags
No related merge requests found
...@@ -13,38 +13,14 @@ function init(grunt, options) { ...@@ -13,38 +13,14 @@ function init(grunt, options) {
stripJsonComments = require('strip-json-comments'), stripJsonComments = require('strip-json-comments'),
path = require('path'), path = require('path'),
config, config,
themes; themes,
file;
config = grunt.file.read(__dirname + '/settings.json'); config = grunt.file.read(__dirname + '/settings.json');
config = stripJsonComments(config); config = stripJsonComments(config);
config = JSON.parse(config); config = JSON.parse(config);
//themes = require(path.resolve(process.cwd(), config.themes)); themes = require(path.resolve(process.cwd(), config.themes));
//TODO: MAGETWO-39843
themes = {
blank: {
area: 'frontend',
name: 'Magento/blank',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
'css/email',
'css/email-inline'
],
dsl: 'less'
},
backend: {
area: 'adminhtml',
name: 'Magento/backend',
locale: 'en_US',
files: [
'css/styles-old',
'css/styles'
],
dsl: 'less'
}
}
if (options.theme) { if (options.theme) {
themes = _.pick(themes, options.theme); themes = _.pick(themes, options.theme);
...@@ -54,6 +30,12 @@ function init(grunt, options) { ...@@ -54,6 +30,12 @@ function init(grunt, options) {
config.themes = themes; config.themes = themes;
file = grunt.option('file');
if (file) {
config.singleTest = file;
}
enableTasks(grunt, config); enableTasks(grunt, config);
} }
......
...@@ -16,7 +16,6 @@ function init(config) { ...@@ -16,7 +16,6 @@ function init(config) {
root = config.root; root = config.root;
port = config.port; port = config.port;
files = config.files; files = config.files;
host = _.template(config.host)({ port: port });
themes = config.themes; themes = config.themes;
_.each(themes, function (themeData, themeName) { _.each(themes, function (themeData, themeName) {
...@@ -26,7 +25,13 @@ function init(config) { ...@@ -26,7 +25,13 @@ function init(config) {
_.extend(themeData, { root: root }); _.extend(themeData, { root: root });
host = _.template(config.host)({ port: port++ });
render = renderTemplate.bind(null, themeData); render = renderTemplate.bind(null, themeData);
if (config.singleTest) {
files.specs = [config.singleTest];
}
specs = files.specs.map(render); specs = files.specs.map(render);
specs = expand(specs).map(cutJsExtension); specs = expand(specs).map(cutJsExtension);
configs = files.requirejsConfigs.map(render); configs = files.requirejsConfigs.map(render);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment