-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: handle case of invalid package.json with no explicit config #5198
Conversation
Since `readFileSync` is only stubbed `onFirstCall` we get a different answer the second time around which is probably Not What You Want. But also we *already checked that config = false*. So you could just remove this test, it does nothing useful.
(signed the CLA!) |
Thanks for the PR! Gave some feedback |
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.
LGTM, nicely done! Agreed with the strategy inside 👍 thanks!
Since @voxpelli was looking at this before, leaving open for re-review.
Btw @dhdaines, just a heads up, the |
Ohhh! Thank you, I have been wondering about that for ages now! (suppose I should have RTF the Markdown manual...) |
Co-authored-by: Josh Goldberg ✨ <[email protected]>
Ah, I suspect that the more obviously invalid JSON will break the too-specific assertion in the test... will fix it in a second. |
Done! |
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 great to me! Just waiting on @voxpelli. Thanks!
PR Checklist
package.json
section #5141status: accepting prs
Overview
Handle the corner case which can happen if:
package.json
which npm was happy withmocha
configuration inside yourpackage.json
npm test
you ranmocha
directly (withnpx
or justmocha.js
)As detailed here: https://github.com/dhdaines/mocha-5141