Skip to content

Conversation

@janicduplessis
Copy link
Collaborator

@janicduplessis janicduplessis commented Nov 9, 2025

Summary

Use regular android unit tests instead of connected tests. This avoids having to build the full app and run an emulator. We can also use the bitrise built in task for android unit tests which gives nice reporting like we have for iOS.

The reason connected tests had to be used is because of ReadableNativeMap, which uses jni, which requires using connected tests.

I used the same technique as the react native unit tests, where they mock the Arguments class to return Java only versions of these classes. This required replacing all places where we created NativeMaps directly with Arguments.createMap.

This cuts down time to run android tests from ~6 minutes to ~3.5 minutes. Not the main motivation for this, but nice added bonus, especially as we add more tests and it could become longer to run.

Motivation

Improve unit test infra.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@janicduplessis janicduplessis force-pushed the @janic/no-connected-tests branch 6 times, most recently from 016325e to 96eea61 Compare November 14, 2025 21:28
@janicduplessis janicduplessis marked this pull request as ready for review November 14, 2025 21:33
@janicduplessis janicduplessis requested review from a team as code owners November 14, 2025 21:33
@janicduplessis janicduplessis enabled auto-merge (squash) November 15, 2025 03:09
@janicduplessis janicduplessis force-pushed the @janic/no-connected-tests branch from 68ba1aa to 11acfcc Compare November 27, 2025 04:06
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.

1 participant