diff --git a/lib/commands.js b/lib/commands.js index 76d0c48..1f4290b 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -10,5 +10,6 @@ module.exports = { noBinLinks: '--no-bin-links', ignoreEngines: '--ignore-engines', noProgress: '--no-progress', - noLockfile: "--no-lockfile" -}; \ No newline at end of file + noLockfile: '--no-lockfile', + ignoreScripts: '--ignore-scripts' +}; diff --git a/test/install_test.js b/test/install_test.js index ea6a7b8..b84e43f 100644 --- a/test/install_test.js +++ b/test/install_test.js @@ -235,6 +235,31 @@ describe('gulp-yarn', function () { stream.end(); }); + it('should run `yarn --ignore-scripts` if stream contains `package.json` and `ignoreScripts` option is set', function (done) { + var file = fixture('package.json'); + + var stream = yarn({ignoreScripts: true}); + + stream.on('error', function (err) { + should.exist(err); + done(err); + }); + + stream.on('data', function () { + }); + + stream.on('end', function () { + commandRunner.run.called.should.equal(1); + commandRunner.run.commands[0].cmd.should.equal('yarn'); + commandRunner.run.commands[0].args.should.eql(['--ignore-scripts']); + done(); + }); + + stream.write(file); + + stream.end(); + }); + it('should run `yarn --no-progress` to disable progress bar', function (done) { var file = fixture('package.json');