Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 34610200D39 for ; Sat, 28 Oct 2017 01:12:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 32F0A160BF2; Fri, 27 Oct 2017 23:12:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 60F53160BF4 for ; Sat, 28 Oct 2017 01:12:54 +0200 (CEST) Received: (qmail 50724 invoked by uid 500); 27 Oct 2017 23:12:53 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 50703 invoked by uid 99); 27 Oct 2017 23:12:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2017 23:12:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A4C9ADF9C2; Fri, 27 Oct 2017 23:12:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: audreyso@apache.org To: commits@cordova.apache.org Date: Fri, 27 Oct 2017 23:12:50 -0000 Message-Id: In-Reply-To: <67a69f6877c64ee58e43de19a7e785cc@git.apache.org> References: <67a69f6877c64ee58e43de19a7e785cc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] cordova-fetch git commit: CB-13492 : updating opts.save and including a tests for no-save archived-at: Fri, 27 Oct 2017 23:12:55 -0000 CB-13492 : updating opts.save and including a tests for no-save Project: http://git-wip-us.apache.org/repos/asf/cordova-fetch/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-fetch/commit/fa85026e Tree: http://git-wip-us.apache.org/repos/asf/cordova-fetch/tree/fa85026e Diff: http://git-wip-us.apache.org/repos/asf/cordova-fetch/diff/fa85026e Branch: refs/heads/1.2.x Commit: fa85026e23f9f3cfd31608f17ef9e59505b0807e Parents: 4c27340 Author: Audrey So Authored: Wed Oct 25 14:19:31 2017 -0700 Committer: Audrey So Committed: Wed Oct 25 14:44:03 2017 -0700 ---------------------------------------------------------------------- index.js | 2 ++ spec/fetch-unit.spec.js | 13 +++++++++++++ 2 files changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-fetch/blob/fa85026e/index.js ---------------------------------------------------------------------- diff --git a/index.js b/index.js index 4284ad4..d17d6c3 100644 --- a/index.js +++ b/index.js @@ -276,6 +276,8 @@ module.exports.uninstall = function (target, dest, opts) { // if user added --save flag, pass it to npm uninstall command if (opts.save) { fetchArgs.push('--save'); + } else { + fetchArgs.push('--no-save'); } // run npm uninstall, this will remove dependency http://git-wip-us.apache.org/repos/asf/cordova-fetch/blob/fa85026e/spec/fetch-unit.spec.js ---------------------------------------------------------------------- diff --git a/spec/fetch-unit.spec.js b/spec/fetch-unit.spec.js index a8c206d..c13f75a 100644 --- a/spec/fetch-unit.spec.js +++ b/spec/fetch-unit.spec.js @@ -70,4 +70,17 @@ describe('unit tests for index.js', function () { }) .fin(done); }); + + it('when save is false, no-save flag should be passed through', function (done) { + var opts = { cwd: 'some/path', production: true, save: false}; + fetch('platform', 'tmpDir', opts) + .then(function (result) { + expect(superspawn.spawn).toHaveBeenCalledWith('npm', jasmine.stringMatching(/--no-save/), jasmine.any(Object)); + }) + .fail(function (err) { + console.error(err); + expect(err).toBeUndefined(); + }) + .fin(done); + }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org