Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --no-shrinkwrap option to npm #152

Merged
merged 1 commit into from
Oct 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/dependency-manager-adapters/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ module.exports = CoreObject.extend({
if (mgrOptions.indexOf('--ignore-engines') === -1) {
mgrOptions = mgrOptions.concat(['--ignore-engines']);
}
} else if (mgrOptions.indexOf('--no-shrinkwrap') === -1) {
mgrOptions = mgrOptions.concat(['--no-shrinkwrap']);
}

return this.run(cmd, [].concat(['install'], mgrOptions), { cwd: this.cwd }).then(function() {
Expand Down
10 changes: 5 additions & 5 deletions test/dependency-manager-adapters/npm-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ describe('npmAdapter', function() {
writeJSONFile('package.json', fixturePackage);
var runCount = 0;
var stubbedRun = generateMockRun([{
command: 'npm install',
command: 'npm install --no-shrinkwrap',
callback: function(command, args, opts) {
runCount++;
expect(opts).to.have.property('cwd', tmpdir);
return RSVP.resolve();
}
}, {
command: 'npm prune',
command: 'npm prune --no-shrinkwrap',
callback: function(command, args, opts) {
runCount++;
expect(opts).to.have.property('cwd', tmpdir);
Expand All @@ -79,13 +79,13 @@ describe('npmAdapter', function() {
writeJSONFile('package.json', fixturePackage);
var runCount = 0;
var stubbedRun = generateMockRun([{
command: 'npm install --no-shrinkwrap=true',
command: 'npm install --no-optional --no-shrinkwrap',
callback: function() {
runCount++;
return RSVP.resolve();
}
}, {
command: 'npm prune --no-shrinkwrap=true',
command: 'npm prune --no-optional --no-shrinkwrap',
callback: function() {
runCount++;
return RSVP.resolve();
Expand All @@ -95,7 +95,7 @@ describe('npmAdapter', function() {
return new NpmAdapter({
cwd: tmpdir,
run: stubbedRun,
managerOptions: ['--no-shrinkwrap=true']
managerOptions: ['--no-optional']
})._install().then(function() {
expect(runCount).to.equal(2, 'Both commands should run');
}).catch(function(err) {
Expand Down