Mmdjastrzebski

rntl-v14-update-deps

Codemod to update dependencies for RNTL v14 migration

transformationmigrationdependencies
Public
15 executions
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

RNTL v14: Update Dependencies

This codemod automatically updates your package.json to prepare for React Native Testing Library v14 migration.

What it does

  • Removes @types/react-test-renderer and react-test-renderer (no longer needed)
  • Moves @testing-library/react-native to devDependencies if it's in dependencies
  • Updates @testing-library/react-native to ^14.0.0-beta.0
  • Adds test-renderer@0.14.0 to devDependencies

Usage

bash

Example

Before:

json

After:

json

Important notes

  • After running the codemod, you must run your package manager to install dependencies:
    bash
  • The codemod sets the version to ^14.0.0-beta.0. You can manually update this if needed.
  • For monorepos, the codemod processes each package.json file individually.

Next steps

  1. Run this codemod to update dependencies
  2. Run npm install (or your package manager) to install the new dependencies
  3. Run the async-functions codemod to update your test code:
    bash
  4. Review and test your changes
Before

This is one example from the codemod's test cases. The codemod may handle many more cases.

Ready to contribute?

Build your own codemod and share it with the community.