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.

jest-watch-plugin - whitelist watchPathIgnorePatterns

See original GitHub issue

Hey,

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
SimenBcommented, Oct 26, 2020
0reactions
github-actions[bot]commented, May 14, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
Configuring Jest. The Jest philosophy is to work great by default, but sometimes you just need more configuration power.
Read more >
How to use the jest-config.defaults.watchPathIgnorePatterns ...
To help you get started, we've selected a few jest-config.defaults.watchPathIgnorePatterns examples, based on popular ways it is used in public projects.
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