jest-watch-plugin - whitelist watchPathIgnorePatterns
See original GitHub issueHey,
We are building an adaptor for Jest & Pact-JS which is available on Github & NPM as Jest-Pact
If I run the adaptor in watch mode, it gets stuck in an infinite loop, as pact-js will generate *.json & *.log files.
I have managed to get over this in consuming projects by telling users to add
watchPathIgnorePatterns: ["pact/logs/*","pact/pacts/*"] into their jest configuration.
I have been looking into how we can incorporate this into our adapter, so that the end-user doesn’t have to add this.
I have been looking at the documentation Jest Watch-Plugins and noted that in the defined whitelist for configuration options that can be set, does not include watchPathIgnorePatterns
Is this something that has purposely been omitted, or is it something that we would be able to support?
Additionally, prior to a full test run, we delete all of the generated *.json files to avoid any clashes with previous test runs. In watch mode, we may only change one file, and therefore only want to delete the corresponding json file to the test, and not every single one. Is this something we can do
- test1.(js|ts)
- test2.(js|ts)
- test3.(js|ts)
Results in
- test1.json
- test2.json
- test3.json
If only test3 is updated, and therefore picked up by jest --watch, I would like to only delete test3.json
I need to dig further into the watch-plugin docs and some existing watch plugins, but thought it would be good to ask here as a first port of call, as it may not be something supported at the moment.
Many thanks for any help or advise!
Existing watch plugins
- jest-watch-directories Select directories to test.
- jest-watch-exec Execute scripts during the watch cycle.
- jest-watch-lerna-packages Select Lerna packages to test.
- jest-watch-master Check changes since master.
- jest-watch-repeat Repeat test runs multiple times.
- jest-watch-select-projects Select which Jest projects to run.
- jest-watch-suspend Suspend watch mode so that your changes would not trigger test runs.
- jest-watch-toggle-config Toggle boolean settings (e.g. verbosity, test coverage).
- jest-watch-typeahead Filter your tests by file name or test name.
- jest-watch-yarn-workspaces Select Yarn workspaces to test.
- node-recorder Toggle recording modes for
node-recorder.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10

Top Related StackOverflow Question
@danielbayley #8714
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.