-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(view): dont immediately exit on first workspace 404 (#7508)
Fixes: #5444 This PR will continue running through all workspaces for `npm view` even when a workspace encounters an `E404` error. This usually happens when you run `npm view -ws` but have private workspaces. A future iteration could log a different message if an `E404` is encountered on a private workspace, but for this PR I wanted to keep it generic since there are a number of reasons a request for a package manifest could 404.
- Loading branch information
1 parent
328f63c
commit ef4c975
Showing
5 changed files
with
282 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,6 +363,153 @@ [email protected] 'claudia' | |
[email protected] 'claudia' | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces 404 workspaces basic > must match snapshot 1`] = ` | ||
[4m[[email protected][39m[24m | [32mACME[39m | deps: [36m2[39m | versions: [36m2[39m | ||
green is a very important color | ||
[91mDEPRECATED[39m!! - true | ||
keywords: [36mcolors[39m, [36mgreen[39m, [36mcrayola[39m | ||
bin: [36mgreen[39m | ||
dist | ||
.tarball: [34mhttp://hm.green.com/1.0.0.tgz[39m | ||
.shasum: [32m123[39m | ||
.integrity: [32m---[39m | ||
.unpackedSize: [34m1.0 GB[39m | ||
dependencies: | ||
[34mred[39m: 1.0.0 | ||
[34myellow[39m: 1.0.0 | ||
maintainers: | ||
- [34mclaudia[39m <[[email protected][22m> | ||
- [34misaacs[39m <[[email protected][22m> | ||
dist-tags: | ||
[34mlatest[39m: 1.0.0 | ||
error [94mcode[39m E404 | ||
error [94m404[39m 404 | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces 404 workspaces json > must match snapshot 1`] = ` | ||
{ | ||
"green": { | ||
"_id": "green", | ||
"name": "green", | ||
"dist-tags": { | ||
"latest": "1.0.0" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "claudia", | ||
"email": "[email protected]", | ||
"twitter": "cyellow" | ||
}, | ||
{ | ||
"name": "isaacs", | ||
"email": "[email protected]", | ||
"twitter": "iyellow" | ||
} | ||
], | ||
"keywords": [ | ||
"colors", | ||
"green", | ||
"crayola" | ||
], | ||
"versions": [ | ||
"1.0.0", | ||
"1.0.1" | ||
], | ||
"version": "1.0.0", | ||
"description": "green is a very important color", | ||
"bugs": { | ||
"url": "http://bugs.green.com" | ||
}, | ||
"deprecated": true, | ||
"repository": { | ||
"url": "http://repository.green.com" | ||
}, | ||
"license": { | ||
"type": "ACME" | ||
}, | ||
"bin": { | ||
"green": "bin/green.js" | ||
}, | ||
"dependencies": { | ||
"red": "1.0.0", | ||
"yellow": "1.0.0" | ||
}, | ||
"dist": { | ||
"shasum": "123", | ||
"tarball": "http://hm.green.com/1.0.0.tgz", | ||
"integrity": "---", | ||
"fileCount": 1, | ||
"unpackedSize": 1000000000 | ||
} | ||
}, | ||
"error": { | ||
"missing-package": { | ||
"code": "E404", | ||
"summary": "404", | ||
"detail": "" | ||
} | ||
} | ||
} | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces 404 workspaces json with package named error > must match snapshot 1`] = ` | ||
warn overwriting existing error on json output | ||
{ | ||
"error": { | ||
"missing-package": { | ||
"code": "E404", | ||
"summary": "404", | ||
"detail": "" | ||
} | ||
} | ||
} | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces 404 workspaces non-404 error rejects > must match snapshot 1`] = ` | ||
[4m[[email protected][39m[24m | [32mACME[39m | deps: [36m2[39m | versions: [36m2[39m | ||
green is a very important color | ||
[91mDEPRECATED[39m!! - true | ||
keywords: [36mcolors[39m, [36mgreen[39m, [36mcrayola[39m | ||
bin: [36mgreen[39m | ||
dist | ||
.tarball: [34mhttp://hm.green.com/1.0.0.tgz[39m | ||
.shasum: [32m123[39m | ||
.integrity: [32m---[39m | ||
.unpackedSize: [34m1.0 GB[39m | ||
dependencies: | ||
[34mred[39m: 1.0.0 | ||
[34myellow[39m: 1.0.0 | ||
maintainers: | ||
- [34mclaudia[39m <[[email protected][22m> | ||
- [34misaacs[39m <[[email protected][22m> | ||
dist-tags: | ||
[34mlatest[39m: 1.0.0 | ||
error Unknown error | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces 404 workspaces non-404 error rejects with single arg > must match snapshot 1`] = ` | ||
green: | ||
1.0.0 | ||
unknown-error: | ||
error Unknown error | ||
` | ||
|
||
exports[`test/lib/commands/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = ` | ||
{ | ||
"green": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters