-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(tests): move more tests to use real npm #3463
Conversation
|
||
exec (args, cb) { | ||
super.exec(args, er => { | ||
if (er && er.code === 'ELIFECYCLE') { |
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.
Nothing in any of the cli code or its dependencies sets this, and the exit handler suppresses the callback error during any command that shells out anyways.
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.
Yes, this is clearly dead code.
package.json
Outdated
@@ -126,6 +126,7 @@ | |||
"@npmcli/arborist", | |||
"@npmcli/ci-detect", | |||
"@npmcli/config", | |||
"@npmcli/package-json", |
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.
Looks like the bundle and gitignore didn't get ran in the packge-json PR.
Tests are failing because As far as I can tell it should ALWAYS have been failing. ETA: it's failing in |
b062c4a
to
ec52585
Compare
Looks like we crossed back over the coverage threshold in the meantime so we can just go forward w/ this w/o having to do the much larger "fix all the coverage" task |
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.
this all looks good to me!
ec52585
to
5d1c8d2
Compare
This moves a handful of the smaller tests to using the new npm mock that uses the real actual npm object. It also extends the testing surface area of a few tests back down into the actual `process.spawn` that results, instead of anything internal to the code. Some dead code in `lib/test.js` was found during this, as well as an instance of a module throwing a string instead of an error object. PR-URL: #3463 Credit: @wraithgar Close: #3463 Reviewed-by: @nlf
5d1c8d2
to
6a8086e
Compare
This moves a handful of the smaller tests to using the new npm mock that
uses the real actual npm object. It also extends the testing surface
area of a few tests back down into the actual
process.spawn
thatresults, instead of anything internal to the code.
Some dead code in
lib/test.js
was found during this, as well as aninstance of a module throwing a string instead of an error object.