Skip to content

☂️ Help us Kotlin-ify React Native tests #37708

@mdvacca

Description

@mdvacca

Description

Hey all 👋
We're looking for some community support to help us prepare the codebase of React Native Android to be ready to migrate to Kotlin. In this first stage we are looking for help to migrate tests to Kotlin

How to migrate a test

If you wish to convert one of the tests you should:

  • Verify that the test is not claimed yet.
  • Comment here that you claim a test.
  • Start working on adding Kotlin support for the test.
    • Make sure your environment is set up correctly (see below)
    • Use this PR as inspiration: Convert RootViewTest to Kotlin - #37227
    • Make sure the test run correctly (see below).
    • Your Kotlin code should be formatted with ktfmt (see below).
  • Send the PR for review. Ping @cortinico and @mdvacca for a review.

Setting up your environment

Make sure your environment is set correctly, specifically you need to:

  1. Fork react-native
  2. Clone react-native locally
  3. Run yarn inside your local fork (installation instruction for yarn are here)
  4. Make sure you have Java 11 installed and the Android SDK configured (you can follow our official guide here)

Running your tests

You can run your tests either by using the Android Studio/IntelliJ UI or by invoking the following command in your React Native fork:

./gradlew :packages:react-native:ReactAndroid:test

Code formatting

Please use KtFmt to format Kotlin tests.
You can use the web UI to reformat directly from the browser:
https://facebook.github.io/ktfmt/

List of tests to migrate

Metadata

Metadata

Assignees

No one assigned

    Labels

    ☂️ UmbrellaTo label issues that serve as coordination point and drivers for tasks in the react-native repoGood first issueInterested in collaborating? Take a stab at fixing one of these issues.Help Wanted :octocat:Issues ideal for external contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions