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:
authorRebecca Turner <me@re-becca.org>2015-07-01 04:11:23 +0300
committerRebecca Turner <me@re-becca.org>2015-07-01 15:07:47 +0300
commit0bb08c88c2b6ae2a07848ce78991dccb99441387 (patch)
tree282aa5f24aab8fa470ee53982a254abd9eac1b8b /test
parentedd744841fef5484bef7446e5a0288cb26426724 (diff)
install: Display errors reading the tree after installation
PR-URL: https://github.com/npm/npm/pull/8778
Diffstat (limited to 'test')
-rw-r--r--test/tap/install-scoped-with-peer-dependency.js2
-rw-r--r--test/tap/ls-l-depth-0.js2
-rw-r--r--test/tap/peer-deps-without-package-json.js5
3 files changed, 4 insertions, 5 deletions
diff --git a/test/tap/install-scoped-with-peer-dependency.js b/test/tap/install-scoped-with-peer-dependency.js
index fdfcf9056..da571ae54 100644
--- a/test/tap/install-scoped-with-peer-dependency.js
+++ b/test/tap/install-scoped-with-peer-dependency.js
@@ -30,7 +30,7 @@ test('it should install peerDependencies in same tree level as the parent packag
common.npm(['install', '--loglevel=warn', './package'], EXEC_OPTS, function (err, code, stdout, stderr) {
t.ifError(err, 'install local package successful')
t.equal(code, 0, 'npm install exited with code')
- t.equal(stderr, 'npm WARN EPEERINVALID @scope/package@0.0.0 requires a peer of underscore@* but none was installed.\n',
+ t.match(stderr, /npm WARN EPEERINVALID @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none was installed[.]\n/,
'npm install warned about unresolved peer dep')
t.end()
diff --git a/test/tap/ls-l-depth-0.js b/test/tap/ls-l-depth-0.js
index ab3189f2e..9aed9da21 100644
--- a/test/tap/ls-l-depth-0.js
+++ b/test/tap/ls-l-depth-0.js
@@ -77,7 +77,7 @@ test('#6311: npm ll --depth=0 duplicates listing', function (t) {
EXEC_OPTS,
function (err, code, stdout, stderr) {
t.ifError(err, 'npm ll ran without error')
- t.notOk(code, 'npm ll exited cleanly')
+ t.is(code, 1, 'npm ll complained about there being no package.json')
t.notOk(stderr, 'npm ll ran silently')
t.equal(
stdout,
diff --git a/test/tap/peer-deps-without-package-json.js b/test/tap/peer-deps-without-package-json.js
index bfb91162c..ad863e9f9 100644
--- a/test/tap/peer-deps-without-package-json.js
+++ b/test/tap/peer-deps-without-package-json.js
@@ -58,9 +58,8 @@ test('installing a peerDeps-using package without package.json', function (t) {
fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')),
'passive peer dep installed'
)
-
- t.is(result.warnings.length, 1, 'got a warning from the peer dep')
- t.is(result.warnings[0].code, 'EPEERINVALID', 'warning is for a missing/invalid peer')
+ var invalid = result.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' })
+ t.is(invalid.length, 1, 'got a warning for a missing/invalid peer dep')
t.end()
s.close() // shutdown mock registry.