Skip to content

Remove remaining commonjs references#4083

Merged
m-bert merged 8 commits intomainfrom
@mbert/jest-commonjs
Apr 13, 2026
Merged

Remove remaining commonjs references#4083
m-bert merged 8 commits intomainfrom
@mbert/jest-commonjs

Conversation

@m-bert
Copy link
Copy Markdown
Contributor

@m-bert m-bert commented Apr 13, 2026

Description

In #4069 we stopped emitting commonjs. Turns out that package.json in jest-utils, as well as in Reanimated components, still referenced this path, thus the tests were failing.

Drawback of removing commonjs is one extra step in tests configuration. This was described in docs.

Test plan

  • Check that functions are available in test app
  • Checked ReanimatedDrawerLayout and ReanimatedSwipeable examples

Copilot AI review requested due to automatic review settings April 13, 2026 07:59
@m-bert m-bert added Documentation Documentation change/enhancement Area: Tests This issue is related to testing labels Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the work from #4069 (stopping commonjs emission) by updating the Jest utilities entrypoint and documenting the additional Jest configuration needed to consume the ESM/module build during tests.

Changes:

  • Update jest-utils/package.json to point main at ../lib/module/... instead of ../lib/commonjs/....
  • Expand testing docs with a “Setup” section describing required transformIgnorePatterns configuration for Jest.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/react-native-gesture-handler/jest-utils/package.json Switches main field to the module build for jest-utils.
packages/docs-gesture-handler/docs/guides/testing.md Adds Jest setup guidance for transforming RNGH from node_modules and reorganizes the mocking section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m-bert m-bert requested a review from j-piasecki April 13, 2026 09:15
@m-bert m-bert changed the title [Jest] Remove remaining commonjs references Remove remaining commonjs references Apr 13, 2026
@m-bert m-bert merged commit dac0e6a into main Apr 13, 2026
2 checks passed
@m-bert m-bert deleted the @mbert/jest-commonjs branch April 13, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tests This issue is related to testing Documentation Documentation change/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants