Convert BaseJavaModuleTest to Kotlin
Summary:
As part of the effort to Kotlin-fy React Native tests, I've converted BaseJavaModuleTest to Kotlin.
Changelog:
[Internal] [Changed] - Convert BaseJavaModuleTest to Kotlin
Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with KtFmt
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 8,744,428 | -3,406 |
| android | hermes | armeabi-v7a | 8,056,635 | -3,800 |
| android | hermes | x86 | 9,235,558 | -3,882 |
| android | hermes | x86_64 | 9,086,375 | -2,863 |
| android | jsc | arm64-v8a | 9,307,265 | -3,164 |
| android | jsc | armeabi-v7a | 8,496,811 | -3,552 |
| android | jsc | x86 | 9,369,285 | -3,641 |
| android | jsc | x86_64 | 9,624,206 | -2,618 |
Base commit: 03f70bf995379f08a77abcf96bb0e31ff75ca8c3 Branch: main
Hello @cortinico, can you have a look at this PR?
@abdennour-jebbar-nw
Thank you so much for taking this on!
Looks good overall, aside from a few stylistic suggestions.
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@cortinico I'm investigating the failing tests
Hey @abdennour-jebbar-nw , what are your plans with the diff?
Will you be able to follow up, or should we maybe close it?
@rshest I'm still following up with this PR, I'm trying to figure out why the moduleWrapper remains null
@rshest I'm still following up with this PR, I'm trying to figure out why the moduleWrapper remains null
@abdennour-jebbar-nw
Hey, I think I know the reason why the remaining two tests were crashing, please see my code suggestions above.
Since the methods in question (and their arguments) were mocked, it's not safe to have them strictly non-nullable. This caused the crash.
@rshest Thank you so much for following up with me, I'll try the changes asap, once green I'll update the PR. Your help was so much appreciated 🙌
This pull request was successfully merged by @abdennour-jebbar-nw in 8ddb334bb08851ea7b5ed68246fcfd0bc36165c0.
When will my fix make it into a release? | Upcoming Releases
@rshest Thank you so much for following up with me, I'll try the changes asap, once green I'll update the PR. Your help was so much appreciated 🙌
@abdennour-jebbar-nw I verified internally that the tests are fixed, so your PR is merged to trunk now. Thank you very much, once again, for working on this! :)