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.

Watch option is ignored when creating JestHasteMap

See original GitHub issue

Do you want to request a feature or report a bug? bug

What is the current behavior? watch is hardcoded to true when creating JestHasteMap: https://github.com/facebook/metro/blob/master/packages/metro/src/node-haste/DependencyGraph.js#L96

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test. https://github.com/hfter789/metro jest packages/metro/src/integration_tests/__tests__/buildGraph-test.js

What is the expected behavior? JestHasteMap should receive the watch value coming from metro config.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
hypestcommented, Jul 15, 2019

We were hoping to use the watch: false option in our React Native release build to prevent having to set fs.inotify.max_user_watches on our CI server.

Sorry for the possible noise on a ticket that might be unrelated but, wanted to add that similar to @FLGMwt , our project needs to have the bundle command not watch for files on CI (JitPack in our case). Would appreciate any pointers on how to suppress file watching in react-native bundle if possible. 😬 🙇

Edit: for the project I’m currently working on, I’ve put a ugly nasty solution in place: to replace the node-haste/DependencyGraph.js file with one that has the watch: flag as false. My hands feel very dirty now, but that unblocks our CI pipeline for the time being.

4reactions
kinkacommented, Jul 12, 2019

before update release, I have to use the patch in this way:

sed -i -e 's/watch: true/watch: false/' node_modules/metro/src/node-haste/DependencyGraph.js

replace the watch: true with watch: false while building on the CI pipelines.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
This option tells Jest that all imported modules in your tests should be mocked automatically. All modules used in your tests will have...
Read more >
jest/index.ts at main · facebook/jest - GitHub
The data structures created by `jest-haste-map` can be used directly from the. * cache without further processing. The metadata objects in the `files`...
Read more >
jest-haste-map | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Top 5 jest-haste-map Code Examples - Snyk
Learn more about how to use jest-haste-map, based on jest-haste-map code examples created from the most popular ways it is used in public...
Read more >
babel-jest - Awesome JS
[babel-plugin-jest-hoist] Ignore TSTypeQuery when checking for hoisted ... Fix inconsistent workspace prefixes (#13217); [jest-haste-map] Expose a minimal ...
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