-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fixed bundle-phobia-install not working #40
Conversation
Codecov Report
@@ Coverage Diff @@
## master #40 +/- ##
=======================================
Coverage 33.78% 33.78%
=======================================
Files 8 8
Lines 293 293
=======================================
Hits 99 99
Misses 194 194
Continue to review full report at Codecov.
|
I actually updated The branch as proposed functions properly (at least on my machine). Because I don't use the feature myself this will probably be my last commit on the branch, I hope it's of some use 😄 |
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.
note to self 🔖: Might be interesting at some point to add real end-to-end test with no code mocking
in fact it might be the time, would be more confident with e2e test with no code mocking
Will try on a subbranch
Co-authored-by: Adrien Becchis <adrien.becchis@gmail.com>
New proposal: if you define the purpose of this command as "conditionally run The commit is a bit large because of renaming all |
@soimon That's a very good idea indeed, and a clear improvement! On my side I worked on the install safety net (cf install-fix-and-e2e), and adapted it to your latest changes, it's green as you can see (I'll open a dedicated PR for extra e2e once this one lands.) |
Great! No problem, nice to finally get the gist of GitHub 😉 |
and here it is @soimon 😉 🙂 |
The
bundle-phobia-install
command didn't work for me, regardless of #37.Every attempt failed with the error
npm install returned with status code undefined
To fix it, I encapsulated the actual
execFile
withinconst performInstall
with a Promise.Reasons to believe that should be the case:
npm-utils.js
returns a PromiseexecFile
is asynchronous, so acting on the direct result instead of in a callback does not guarantee the process has been finishedres.code
whereres
is the result ofexecFile
. The resultingChildProcess
does in fact not contain a property calledcode
(hence the "status code undefined")The reason this has not been identified in integration tests is that the test in question mocks the
execFile
(incorrectly: it contains a propertycode
which the documentedChildProcess
doesn't), so it never has to deal with a process error. I would propose a fix for this as well, but I do not feel confident enough in your testing stack so I'll leave that decision to the author 🤕🤷♂️(If all is well you should be able to commit to my branch)