Skip to content

Commit

Permalink
feat(commands): add ignore-scripts option
Browse files Browse the repository at this point in the history
  • Loading branch information
glebec committed Feb 22, 2017
1 parent 9193072 commit 0827b84
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ module.exports = {
noBinLinks: '--no-bin-links',
ignoreEngines: '--ignore-engines',
noProgress: '--no-progress',
noLockfile: "--no-lockfile"
};
noLockfile: '--no-lockfile',
ignoreScripts: '--ignore-scripts'
};
25 changes: 25 additions & 0 deletions test/install_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 0827b84

Please sign in to comment.