diff --git a/lib/techs/v2/deps.js.js b/lib/techs/v2/deps.js.js index 9d35c74d..ce7a2ce3 100644 --- a/lib/techs/v2/deps.js.js +++ b/lib/techs/v2/deps.js.js @@ -193,6 +193,7 @@ var Deps = exports.Deps = INHERIT({ items[itemKey] = item; item.include && this.itemsByOrder.push(itemKey); } else if(!itemByKey.include && item.include) { + // update `include` for existing item in case of adding of new item without `include: false` itemByKey.include = true; this.itemsByOrder.push(itemKey); } @@ -418,7 +419,7 @@ var Deps = exports.Deps = INHERIT({ var key = i.buildKey(), ctxTech = ctx && ctx.item.tech || ''; if(!uniq.hasOwnProperty(key) || !uniq[key].hasOwnProperty(ctxTech)) { - if(i.include) { + if(i.include) { // include only items without `include: false` (uniq[key] || (uniq[key] = {}))[ctxTech] = true; var newCtx = ctx || i; _this.forEach(fn, uniq, i.mustDeps, newCtx); diff --git a/test/v2-deps.js b/test/v2-deps.js index 81df0513..d1fedd58 100644 --- a/test/v2-deps.js +++ b/test/v2-deps.js @@ -10,7 +10,6 @@ var assert = require('chai').assert, * * @name describe @function * @name it @function - * @name xit @function * @name before @function * @name after @function * @name beforeEach @function @@ -111,13 +110,13 @@ describe('Deps', function() { )); // TODO: https://github.com/bem/bem-tools/issues/401 - //xit('block with elem array', assertDepsParse( - //[ { block: 'b1', elem: ['e1', 'e2'] } ], - //{ '': {'': [ - //{block: 'b1', elem: 'e1'}, - //{block: 'b1', elem: 'e2'} - //] } } - //)); + it.skip('block with elem array', assertDepsParse( + [ { block: 'b1', elem: ['e1', 'e2'] } ], + { '': {'': [ + {block: 'b1', elem: 'e1'}, + {block: 'b1', elem: 'e2'} + ] } } + )); }); @@ -153,14 +152,14 @@ describe('Deps', function() { )); // TODO: https://github.com/bem/bem-tools/issues/413 - //xit('block with tech shortcut', assertDepsParse( - //{block: 'b1', tech: 't1', shouldDeps: {tech: 't2'}}, - //{ 't1': { - //'t1': [ { block: 'b1', tech: 't1'} ], - //'t2': [ { block: 'b1', tech: 't2'} ] - //} - //} - //)); + it.skip('block with tech shortcut', assertDepsParse( + {block: 'b1', tech: 't1', shouldDeps: {tech: 't2'}}, + { 't1': { + 't1': [ { block: 'b1', tech: 't1'} ], + 't2': [ { block: 'b1', tech: 't2'} ] + } + } + )); it('block with and without tech', assertDepsParse( { block: 'b1', shouldDeps: { block: 'b2', tech: 't2', shouldDeps: { block: 'b3' } } },