Skip to content
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

Merge haste configs if they are available #281

Merged
merged 2 commits into from
May 21, 2024

Conversation

colinta
Copy link
Contributor

@colinta colinta commented May 17, 2024

Per Slack discussion:

In rules_jest, is "_jest_config_template" meant to be configurable?

(why? config.haste = { enableSymlinks: true } is conflicting with React-native preset's haste: { defaultPlatform: 'ios', platforms: […], } configuration)

@gregmagolan told me to "go do it yourself!" (not his words)

The fix would be to merge the two together. Would be happy to accept a PR for that.

👍


Changes are visible to end-users: no

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

jest_test will now preserve your jest.config.js settings.

jest_test(
  …
  config = "jest.config.js",  # previously, `haste` configuration in this file would be overridden
)

Test plan

  • Covered by existing test cases
  • New test cases added (jest/test/case14*)
  • Manual testing; please provide instructions so we can reproduce:

Add haste configuration to jest.config.js, watch it get merged into the defaults { enableSymlinks: true } defined in jest_config_template.mjs

@CLAassistant
Copy link

CLAassistant commented May 17, 2024

CLA assistant check
All committers have signed the CLA.

@colinta
Copy link
Contributor Author

colinta commented May 21, 2024

Updated this to include tests:

bazel test //jest/tests:all
INFO: Analyzed 65 targets (0 packages loaded, 84 targets configured).
INFO: Found 52 targets and 13 test targets...
INFO: Elapsed time: 1.434s, Critical Path: 1.25s
INFO: 3 processes: 2 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
//jest/tests:case1                                              (cached) PASSED in 2.6s
//jest/tests:case11a                                            (cached) PASSED in 2.7s
//jest/tests:case11b                                            (cached) PASSED in 2.6s
//jest/tests:case12                                             (cached) PASSED in 2.2s
//jest/tests:case13                                             (cached) PASSED in 1.5s
//jest/tests:case2a                                             (cached) PASSED in 2.0s
//jest/tests:case2b                                             (cached) PASSED in 1.1s
//jest/tests:case5                                              (cached) PASSED in 2.6s
//jest/tests:case6                                              (cached) PASSED in 2.6s
//jest/tests:case7                                              (cached) PASSED in 2.6s
//jest/tests:case8                                              (cached) PASSED in 1.1s
//jest/tests:case9                                              (cached) PASSED in 2.2s
//jest/tests:case14                                                      PASSED in 1.0s

Executed 1 out of 13 tests: 13 tests pass.

Case 14 adds a file case14-lib.foo.js that is not picked up without this patch: https://gist.github.com/colinta/689d5834e52b3ff9e767d4894b58f16a

Copy link
Member

@gregmagolan gregmagolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@gregmagolan gregmagolan merged commit 76b65ae into aspect-build:main May 21, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants