Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

test: add lib/logout.js unit tests #1698

Closed

Conversation

ruyadorno
Copy link
Contributor

  • Fixed config.delete to remove from user config on logout
  • Tidy up lib/logout.js code
  • Added test/lib/logout.js unit tests

- Fixed config.delete to remove from user config on logout
- Tidy up lib/logout.js code
- Added test/lib/logout.js
@ruyadorno ruyadorno requested a review from a team as a code owner August 21, 2020 18:00
if (scope) {
const scopedRef = npm.flatOptions[regRef]
reg = scopedRef || reg
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could get rid of a let with something like this:

const { registry, scope } = npm.flatOptions
const regRef = scope ? `${scope}:registry` : 'registry'
const reg = npm.flatOptions[regRef] || registry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooohh looks better yeah! feel free to fix it in the patch commit 😊

isaacs pushed a commit that referenced this pull request Aug 21, 2020
- Fixed config.delete to remove from user config on logout
- Tidy up lib/logout.js code
- Added test/lib/logout.js

PR-URL: #1698
Credit: @ruyadorno
Close: #1698
Reviewed-by: @isaacs
@isaacs
Copy link
Contributor

isaacs commented Aug 21, 2020

Landed on 7.0.0-beta.6

@isaacs isaacs closed this Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants