-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Extend updateConfigAndRun
to allow change of verbose
and collectCoverage
#6467
Comments
I agree! I think it would be great to expand this to a broader set of config options. We should also explicitly mention in the docs which are the options that can be overridden. We could also add I'm also happy to review the PR |
Hey @rogeliog I'm trying to contribute to the codebase, but the current master utterly fails to work for me… Let me elaborate:
So I can add code and build, and interactively try it by using Any help appreciated 😉 |
|
Hey @SimenB thanks for the tip! It worked like a charm. This was indeed not a clean clone, my fork had existed for a long time and had this leftover |
the eslint plugin error is probably the same thing - previously that plugin was part of this monorepo. So I'd guess you have a symbolic link in root |
I went ahead and did a fresh clone of my fork, fixed the whole shenanigans. Thx! |
* Allow WatchPlugins access to a broader list of global config options Refs #6467 * Tests for whitelisting config options in WatchPlugins * Docs on allowed config options in WatchPlugins * chore: Changelog * tests: leverage it.each to clean up code * refactor: centralize config update logic * Update plugin test to use new signature for configs * Refactor watch extensions as per PR review (#6473)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
The current scope of accepted config keys is super narrow (and the documentation doesn't say anything about it).
Motivation
The two most asked-for watch plugins that are not yet implemented are:
Both are trivial to implement, provided that the passed
updateConfigAndRun()
function takes the relevant global config keys into account. Currently, it only accepts the minimum set of config keys required to implement the internal plugins, not one more. Fortunately, this was enough to implement the typeahead plugin, as it's just an overwrite of the logic for the non-typeahead internal plugin, but that's as far as it goes.Note that IMHO, the global config should be audited for prime candidate keys that seem innocuous enough to expose to watch plugins. It's likely that
bail
,collectCoverageFrom
,collectCoverageOnlyFrom
,coverageDirectory
,coverageReporters
,notify
,notifyMode
,onlyFailures
andreporters
would be good candidates that do not impede core's ability to function when tweaked.Example
collectCoverage
would let us implement a coverage togglerverbose
would let us implement a verbosity toggler.Pitch
Why does this feature belong in the Jest core platform?
Because it can't be implemented from the outside. For obvious reasons, the passed global config is immutable, and the one used by
watch()
is a local reference that it is the only scope to access.I'm willing to help with changes in core, and have the two aforementioned plugins at the ready (or almost so, for coverage, as I want to expand it further).
Let me know!
The text was updated successfully, but these errors were encountered: