Skip to content

Commit

Permalink
Merge pull request #525 from magento-south/jsunit
Browse files Browse the repository at this point in the history
Bug
- MAGETWO-59870 Grunt spec task runs on incorrect ports for several areas
  • Loading branch information
VladimirZaets authored Oct 20, 2016
2 parents 8ee63a1 + 4ab99cd commit cbe29b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 29 deletions.
38 changes: 10 additions & 28 deletions dev/tests/js/jasmine/spec_runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,14 @@ function init(grunt, options) {
stripJsonComments = require('strip-json-comments'),
path = require('path'),
config,
themes;

themes,
file;

config = grunt.file.read(__dirname + '/settings.json');
config = stripJsonComments(config);
config = JSON.parse(config);

//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'
}
}
themes = require(path.resolve(process.cwd(), config.themes));

if (options.theme) {
themes = _.pick(themes, options.theme);
Expand All @@ -54,6 +30,12 @@ function init(grunt, options) {

config.themes = themes;

file = grunt.option('file');

if (file) {
config.singleTest = file;
}

enableTasks(grunt, config);
}

Expand Down
7 changes: 6 additions & 1 deletion dev/tests/js/jasmine/spec_runner/tasks/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function init(config) {
root = config.root;
port = config.port;
files = config.files;
host = _.template(config.host)({ port: port });
themes = config.themes;

_.each(themes, function (themeData, themeName) {
Expand All @@ -26,7 +25,13 @@ function init(config) {

_.extend(themeData, { root: root });

host = _.template(config.host)({ port: port++ });
render = renderTemplate.bind(null, themeData);

if (config.singleTest) {
files.specs = [config.singleTest];
}

specs = files.specs.map(render);
specs = expand(specs).map(cutJsExtension);
configs = files.requirejsConfigs.map(render);
Expand Down

0 comments on commit cbe29b0

Please sign in to comment.