Skip to content

Conversation

kitten
Copy link

@kitten kitten commented Aug 17, 2025

Proposal to remove react-native/jest-preset in favour of a separate @react-native/jest-preset package.

View the rendered RFC

@kitten kitten force-pushed the @kitten/rfc/split-jest-from-react-native-core branch from 1891779 to 22e7083 Compare August 17, 2025 10:31
Comment on lines 78 to 84
## Alternatives

- **Continue including Jest:** We could continue including the preset, and take on the maintenance burden associated with this, as long as development and support is revilatised.
- **Switch default testing framework:** We could replace Jest with another test framework and runner like Vitest. However, this increases maintenance burden.
- **Minimal testing interface:** We could create a framework-agnostic unit testing interface. However, `@testing-library/react-native` already exists.

This proposal was chosen partially because options for E2E testing already exist, and alternative runners can use `@testing-library/react-native`. The main complexity of replacing Jest for React Native is associated with bundling. However, as new projects make strides in supporting more projects, as long as native-platform-extension support and Babel preset transpilation of all modules is possible, a test framework can start supporting React Native. Removing the `jest-preset` from `react-native` signals to contributors to encourage other test runners to support React Native, and encourages external maintenance of new test runners.
Copy link

@byCedric byCedric Aug 17, 2025

Choose a reason for hiding this comment

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

FWIW, @testing-library/* also runs in other systems. Like Bun: https://bun.com/guides/test/testing-library

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