diff --git a/lib/index.js b/lib/index.js index 55b880b2..6148bdbd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -472,8 +472,19 @@ Base.prototype.run = function run(cb) { */ Base.prototype.composeWith = function composeWith(namespace, options, settings) { - settings = settings || {}; var generator; + settings = settings || {}; + options = options || {}; + + // Pass down the default options so they're correclty mirrored down the chain. + options = _.extend({ + options: _.extend({ + skipInstall: this.options.skipInstall, + 'skip-install': this.options.skipInstall, + skipCache: this.options.skipCache, + 'skip-cache': this.options.skipCache + }, options.options) + }, options); if (settings.local) { var Generator = require(settings.local); diff --git a/test/base.js b/test/base.js index 20e04257..35ad0000 100644 --- a/test/base.js +++ b/test/base.js @@ -689,7 +689,7 @@ describe('Base', function () { resolved: 'unknown', namespace: 'dummy', env: this.env, - 'skip-install': true + skipInstall: true }); this.spy = sinon.spy(); @@ -706,6 +706,8 @@ describe('Base', function () { setTimeout(function () { this.dummy.run(function () { sinon.assert.callOrder(runSpy, this.spy); + assert.equal(this.spy.thisValues[0].options.skipInstall, true); + assert.equal(this.spy.thisValues[0].options['skip-install'], true); assert(this.spy.calledAfter(runSpy)); done(); }.bind(this)); diff --git a/test/install.js b/test/install.js index fbf5454b..65e2ada9 100644 --- a/test/install.js +++ b/test/install.js @@ -152,6 +152,7 @@ describe('Base (actions/install mixin)', function () { this.dummy.run(); }); }); + describe('#yarnInstall()', function () { it('spawn an install process once per commands', function (done) { this.dummy.yarnInstall();