You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way for Watcher Plugins to add test suites to be run.
This could be done by:
adding a "add test suite" to the callback for jestHooks.fileChanged
provide a new hook like jestHooks.mustRunTestSuite(testSuiteInfo)
change the jestHooks.shouldRunTestSuite(testSuiteInfo) behaviour so that it is called for all tests (not just those not already filtered out).
Motivation
This would allow tests to be run on conditions outside of the watcher's scope, such as when files used to dynamically build tests are changed, or when files are indirectly imported.
Example
We have two examples in the code base where we're currently updating a comment in tests so that the 'on-change' behaviour runs them:
Tests that rely on generated graphql schema stitched together from a glob pattern that is "imported" independently using fs.readFileSync
Tests that are generated by reading a directory of ".json" template files.
Pitch
At the moment these use cases can't be achieved with the existing watcher plugin behaviour.
My two example use-cases is likely to be too specific to be directly supported by core. But by extending the watcher, you enable people in similar situations (where not all files that change a test are obvious to hastemap) to write the plugins they need.
The text was updated successfully, but these errors were encountered:
While I cannot guarantee anything regarding if it'll get merged or not, I'm happy to review a PR adding support for this. Empowering watch plugins sounds attractive to me.
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
Provide a way for Watcher Plugins to add test suites to be run.
This could be done by:
jestHooks.fileChanged
jestHooks.mustRunTestSuite(testSuiteInfo)
jestHooks.shouldRunTestSuite(testSuiteInfo)
behaviour so that it is called for all tests (not just those not already filtered out).Motivation
This would allow tests to be run on conditions outside of the watcher's scope, such as when files used to dynamically build tests are changed, or when files are indirectly imported.
Example
We have two examples in the code base where we're currently updating a comment in tests so that the 'on-change' behaviour runs them:
fs.readFileSync
Pitch
At the moment these use cases can't be achieved with the existing watcher plugin behaviour.
My two example use-cases is likely to be too specific to be directly supported by core. But by extending the watcher, you enable people in similar situations (where not all files that change a test are obvious to hastemap) to write the plugins they need.
The text was updated successfully, but these errors were encountered: