question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does the extending configuration feature work?

See original GitHub issue

Opening this as a question as I’m not yet sure whether it’s a bug or a user error 😄

The docs on extending configuration state:

Configurations can inherit from other modules using the extends keyword

However, I’ve been unable to get this to work and I haven’t been able to find any Mocha-specific examples leveraging extends. I’ve tried using extends both with a relative path to a json file, as well as with a module as referenced in the yargs docs linked from the Mocha docs, and I also tried the various Mocha config file formats (js, yaml, json, etc.) to define the Mocha config with the extends keyword, all to no avail.

I created a really simple repo here that reproduces this behavior:

ui should be set to tdd via the extends reference in the .mocharc.yml file, but running an npm test results in a reference error ReferenceError: suite is not defined leading me to believe that extends is not working since the ui is still set to the default bdd

Any help would be greatly appreciated!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
juergbacommented, May 21, 2019

@calebcartwright yes, that would have been the test I had in mind. Thanks for your investigations.

I did some tests and my conclusion is: in some edge cases it works, but in general it does not work. So yes, a bug.

  • extends is a Yargs feature, which in Mocha runs too late, when all CLI plus config options have been read and default values have been set. Furthermore it runs outside of the public loadOptions() function.
  • extends should run earlier in Yargs-parser, which has a similar feature config. there could be a conflict: Mocha config <==> yargs-parser config
  • which priority between extend object and configObjects (and default values)?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending Configuration Support - Quarkus
This allows overriding values from other sources or falling back to other values.
Read more >
Chapter 5. Modularizing configurations - Spring
As a convenience, @Configuration classses can extend ConfigurationSupport , primarily in order to facilitate easy lookup of beans from the enclosing ...
Read more >
How To Extend and Customize Auto-Configuration Classes ...
For start, we need to define annotation which will allow binding feature specific components & configurations with a dedicated spring profile.
Read more >
Extending and customizing auto-configuration classes ...
Imagine a scenario when we need to enable certain spring boot auto-configuration on a subset of environments only.
Read more >
Understand the machine configuration feature of Azure Policy
Learn how Azure Policy uses the machine configuration feature to audit or configure settings inside virtual machines.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found