Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Oxley <secoif@gmail.com>2014-05-11 01:18:46 +0400
committerTim Oxley <secoif@gmail.com>2014-05-11 01:18:46 +0400
commit65f4cb39f27d55a068f98404c35b41e371dec945 (patch)
tree07c7f7546e9bd047b9d1a1ce6fb24456c7b49a24 /test
parentc8242a25a091de4cc68e6178ff8fb756657e4902 (diff)
Stop optional deps moving into deps on update --save
This probably undesirable behaviour stems from normalize-package-data: > The values in optionalDependencies get added to dependencies. The optionalDependencies array is left untouched. Solution Caveat: regular dependencies that are also optional (does that even make sense?) will not be updated with --save because there's no way to detect which optional dependencies aren't also regular dependencies – we just avoid updating anything optional during --save.
Diffstat (limited to 'test')
-rw-r--r--test/tap/update-save.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/tap/update-save.js b/test/tap/update-save.js
index 7a8801b1c..6323ef851 100644
--- a/test/tap/update-save.js
+++ b/test/tap/update-save.js
@@ -107,10 +107,7 @@ test("optionalDependencies are merged into dependencies during --save", function
t.equal(code, 0)
var pkgdata = JSON.parse(fs.readFileSync(PKG, 'utf8'))
- t.deepEqual(pkgdata.dependencies, {
- mkdirp: '^0.3.5',
- underscore: '^1.3.3'
- }, 'dependencies should be updated with optional dependencies')
+ t.deepEqual(pkgdata.dependencies, {mkdirp: '^0.3.5'}, 'dependencies should not include optional dependencies')
t.deepEqual(pkgdata.devDependencies, pkg.devDependencies, 'dev dependencies should be untouched')
t.deepEqual(pkgdata.optionalDependencies, pkg.optionalDependencies, 'optional dependencies should be untouched')
t.end()