-
Notifications
You must be signed in to change notification settings - Fork 3k
Add a success message to adduser/login #10903
Conversation
Thanks for putting this together, and thanks for cleaning up the tests! Two bits of feedback:
If you can work those bits in, we'll get this merged in the next following release. Thanks again for your time! |
6dde2b6
to
0609eaa
Compare
That seems better indeed. With a scope it prints: Also removed the color. |
Fantastic! Pending Travis being green, this can be merged to both |
|
||
if (remaining === 0) runner.stdin.end() | ||
test('npm login --scope', function (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@othiym23, maybe the --scope
test should check a few other things as well?
Examples:
- That
@scope:registry
is set to the registry URI in the config upon completion. - That the correct registry URI is set when a scope is given.
I.e. this block of code: https://github.com/npm/npm/blob/master/lib/adduser.js#L133-L140 (by the way, what does the multiple argument npm.config.get
do here (npm.config.get('registry', 'cli')
)?
Could test the @
prefixing of scopes too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the multiple argument
npm.config.get
do here (npm.config.get('registry', 'cli')
)?
npm uses a package called config-chain
to set up the precedence hierarchy between the various configuration files, environment variables, and configuration options set as command-line arguments. It's not really widely-known, but you can query one of those sources in particular by passing its name to config.get()
as the second parameter, as you see here. The reason for this is that for the specific case of npm login
, we don't want a scope
set in a config file to trigger the scope-specific behavior for login.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, those tests sound like great ideas. You have a few days until we're going to be in a position to merge this change, so if you want to try other approaches and refine the tests, that would be greatly appreciated. Just let us know, so we can re-review before merging. Thanks for your help!
Added a few tests for |
0.8 http streams have a bug, where if they're paused with data in their buffers when the socket closes, they call `end` before emptying those buffers, which results in the entire pipeline ending and thus the point that applied backpressure never being able to trigger a `resume`. We work around this by piping into a pass through stream that has unlimited buffering. The pass through stream is from readable-stream and is thus a current streams3 implementation that is free of these bugs even on 0.8. PR-URL: #10903 Credit: @iarna
This was merged to 3.6.0 & 2.14.16! =) |
Great! |
Basically just adds a green
Authentication successful.
message to login/adduser (fixes #10775):Also refactors some of the adduser tests to have less duplicate code.