Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Elminate warnings about missing package.json at top level #9343

Closed
wants to merge 1 commit into from

Conversation

iarna
Copy link
Contributor

@iarna iarna commented Aug 19, 2015

npm@2 didn't emit these and to be honest, it's not that interesting. The test change actually just reverts a previous test change when these warnings were introduced.

This will half fix #9113

@iarna iarna added this to the 3.x-next milestone Aug 19, 2015
@@ -146,7 +146,8 @@ function getLite (data, noname) {
lite.problems.push('extraneous: ' + getPackageId(data) + ' ' + (data.path || ''))
}

if (data.error && data.path !== path.resolve(npm.globalDir, '..')) {
if (data.error && data.path !== path.resolve(npm.globalDir, '..') &&
(data.error.code !== 'ENOENT' || noname)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add (or verify exists) a test that DOES trigger an error at the bottom from a top level package. Invalid package.json.

@othiym23
Copy link
Contributor

Reviewed by me via ScreenHero, with the suggestion of adding a sad path test. 🐑 once that's added.

@iarna iarna force-pushed the iarna/fix-top-level-errors branch from 60e44ab to 6575ac3 Compare August 20, 2015 20:05
iarna added a commit that referenced this pull request Aug 21, 2015
@iarna iarna added ready and removed in-progress labels Aug 21, 2015
test('ls-top-errors', function (t) {
common.npm(['ls'], {cwd: pkg}, function (er, code, stdout, stderr) {
t.ifErr(er, 'install finished successfully')
t.is(stderr, expected)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these would be be less fragile w/ a regex match

@iarna iarna force-pushed the iarna/fix-top-level-errors branch from 6575ac3 to a31958e Compare August 21, 2015 19:25
iarna added a commit that referenced this pull request Aug 21, 2015
@othiym23
Copy link
Contributor

Landed as 02420dc. It's fitting that these trees are getting "elminated"! Thanks, Rebecca!

@othiym23 othiym23 closed this Aug 28, 2015
@iarna iarna deleted the iarna/fix-top-level-errors branch September 9, 2015 22:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants