-
-
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
No double reloading defaults, fixes #3808 #3820
Conversation
The test for Line 26 in e654253
which has the same effect? |
I think the bug can be found here: lib/utils.js
This is probably the reason:
|
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.
Thanks for the PR. Please revert this change, and see juergba's comment.
That code needs to be changed to use the contents of the extension
option instead of .js
.
I think we have more than one bug here. Something is wrong with the parsing of the
@dedene You have to get rid of this default |
This is likely the reason. It's a regression, then. Essentially, I think we're going to need a special case that says "when merging the default configuration, if |
We want "combine arrays" to work in all other cases (AFAIK!) except this one. |
@dedene this is kind of hairy, and there's no easy way to make |
@juergba @boneskull thanks for the feedback! I don't have much time this week, so feel free to take it over. Shall I close the PR or can you edit and continue on this PR? |
@boneskull maybe you can use yargs "coerce" option. When you do it before reducing the array to unique values, the logic is simple: |
closed in lieu of #3834 |
Description of the Change
As the mocha defaults were merged early on(https://github.com/mochajs/mocha/blob/master/lib/cli/options.js#L331), it prevented the yargs parser to properly fallback to its defaults configuration for each cli argument (which are coming from the same defaults (https://github.com/mochajs/mocha/blob/master/lib/cli/run.js#L26). With this fix 'js' is no longer always included in the list of extensions.
Why should this be in core?
This fixes issue #3808
Benefits
Allow mocha to properly run i.e. in Typescript based projects.