Skip to content

test: add lib/link.js tests #1786

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed

Conversation

ruyadorno
Copy link
Contributor

@ruyadorno ruyadorno commented Sep 10, 2020

  • Added ELINKGLOBAL error code for when using --global
  • Added tests for lib/link.js
  • Do not reify, only load globals when linking a pkg to a local prefix
  • Tweaked npm link <pkg> behavior to symlink to available package in global dir if possible, if not reify missing pkg into global dir then reify-symlink it to local dir
  • Bumped @npmcli/arborist@0.0.23
  • Fixes: [BUG] npm link <pkg>, error links.map is not a function in v7 #1777

NOTE: Tests are not mocking Arborist since I think this is a cmd that might help us out surfacing underlying issues, similar to npm ls

- Added ELINKGLOBAL error code for when using --global
- Added tests for lib/link.js
- Do not reify, only load globals when linking a pkg to a local prefix
- Fixes: npm#1777
@ruyadorno ruyadorno requested a review from a team as a code owner September 10, 2020 03:24
ruyadorno added a commit to npm/arborist that referenced this pull request Sep 10, 2020
related to: npm/cli#1786

Co-authored-by: isaacs <i@izs.me>
isaacs pushed a commit to npm/arborist that referenced this pull request Sep 10, 2020
related to: npm/cli#1786

Co-authored-by: isaacs <i@izs.me>

PR-URL: #125
Credit: @ruyadorno
Close: #125
Reviewed-by: @isaacs
@ruyadorno ruyadorno added the Release 7.x work is associated with a specific npm 7 release label Sep 11, 2020
@ruyadorno ruyadorno added this to the v7.0.0-rc.0 milestone Sep 11, 2020
@darcyclarke darcyclarke added beta Enhancement new feature or improvement labels Sep 11, 2020
Being able to npm link a package that is not currently available in the
global space should still be a supported feature, this change puts that
functionality back in place but also improves it by avoiding reify any
package that may already be found in the global directory.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Enhancement new feature or improvement Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants