Upgrade roboletric and junit versions to be consistent (#22395)# Why The bumping of robolectric to 4.10 means that we no longer need jetifier to translate old support library dependencies. #
Upgrade roboletric and junit versions to be consistent (#22395)# Why The bumping of robolectric to 4.10 means that we no longer need jetifier to translate old support library dependencies. # How * Updates `robolectric` to `4.10` and `junit` to `4.13.2` * Updates test dependencies in `expo-modules-test-core` to their latest versions * A minor change needed to be made to the `expo-clipboard` test because of changes to the way that robolectric handles decoding bitmaps for tests. # Test Plan Ensured [unit tests still pass](https://github.com/josephyanks/expo/actions/runs/4896200135/jobs/8742724860) Trying to verify end to end tests locally.
show more ...
[test-core][android] Improve module mocking (#17519)- Exposed a spy object of actual `Module` instance (as a `moduleSpy` variable available in the test block scope). This adds a possibility to mock
[test-core][android] Improve module mocking (#17519)- Exposed a spy object of actual `Module` instance (as a `moduleSpy` variable available in the test block scope). This adds a possibility to mock module class members. - Added a possibility to provide both `Module` and `AppContext` instances to `ModuleMock.createMock` already as a `spyk()` objects. This makes additional mock setup possible. - Added a utility function `assertCodedException` to perform some common assertions of exceptions thrown by module methods. Co-authored-by: Łukasz Kosmaty <[email protected]>
[tests-core][android] Try fix "ReactContext is null" (#17350)The `AppContext` class holds only a weak reference to the `ReactContext` instance. I suspect that when there are lots of tests with diff
[tests-core][android] Try fix "ReactContext is null" (#17350)The `AppContext` class holds only a weak reference to the `ReactContext` instance. I suspect that when there are lots of tests with different Robolectric test configurations (API level, custom shadows etc.), moreover, some of them are being run in parallel, Robolectric sometimes destroys (garbage collects?) the context instance too early, before some tests can finish. I made `AppContext` a spy and overridden the `reactContext` getter to always return a strong reference to the `ReactApplicationContext` object (a proxy to the `android.content.Context`). It is created locally, but the `every { ... } returns context` construct stores the reference in MockK internals. * Fix module mock context * Uncomment clipboard tests
[android] Fix clipboard unit test
[android] Disable all Clipboard module testsUntil resolved the "React Application Context is null" issue. Any test in this suite randomly fails with this error.
[android][ios] Upgrade to react-native 0.68 (#16532)# Why targeting react-native 0.68 in sdk 45 even though it's rc now. # How - [x] upgrade package.json - [x] migrate bare-expo - [x] mi
[android][ios] Upgrade to react-native 0.68 (#16532)# Why targeting react-native 0.68 in sdk 45 even though it's rc now. # How - [x] upgrade package.json - [x] migrate bare-expo - [x] migrate expo-template-bare-minimum - [x] migrate bare-sandbox ❗️ reanimated build error because our previous integration is broken on AGP 7. solution in [the pr](https://github.com/software-mansion/react-native-reanimated/pull/3113). since the pr is not landed yet, i have a [temporarily workaround to patch reanimated](https://github.com/expo/expo/pull/16532/commits/8e5662bec377ea11edc21ec6114c39f6580cb56a). # Test Plan - android bare-expo launch test - ios bare-expo launch test
[clipboard] Redesign event listener (#16787)* Android * iOS * JS * HTML is Text too * Suppress warnings * Update CHANGELOG * Update docs example * Use enums * Apply suggesti
[clipboard] Redesign event listener (#16787)* Android * iOS * JS * HTML is Text too * Suppress warnings * Update CHANGELOG * Update docs example * Use enums * Apply suggestions
[android] Temporarily comment out randomly failing testSometimes this test causes CI to fail with some kind of transient error"React Application Context is null"
[clipboard] Add support for HTML content (#16551)* Implement Android * Implement iOS * [android] HTML -> Text conversion * JS, docs * Update CHANGELOG * Export types * Apply sugge
[clipboard] Add support for HTML content (#16551)* Implement Android * Implement iOS * [android] HTML -> Text conversion * JS, docs * Update CHANGELOG * Export types * Apply suggestions
[clipboard][Android] Add support for images (#16413)* Native Android implementation * Add native unit tests * Update test suite * Update docs * Update CHANGELOG * Apply suggestions
[clipboard][Android] Add support for images (#16413)* Native Android implementation * Add native unit tests * Update test suite * Update docs * Update CHANGELOG * Apply suggestions * Fix rebase
[modules-core][android] Improve test library (#16416)# Why Part of ENG-4140. This PR introduces a new way of mocking an expo module. Currently, the code lives in the `unimodules-core-test` pa
[modules-core][android] Improve test library (#16416)# Why Part of ENG-4140. This PR introduces a new way of mocking an expo module. Currently, the code lives in the `unimodules-core-test` package. I plan to rename that later. # How Existing mocking mechanism forces as to call methods via their names and mock the promise. It works fine, however, we can do it better. Our modules API promotes writing promises-less functions (promises are hidden from users). So why do we have to deal with promises even if the call on the native side is 100% sync? Therefore, I've created an abstraction that uses the invocation handler to remove promises. ## How does it work? Firstly, you have to create a module test interface that will be used to call functions exported via DSL. You can think of that as a native interface for js exported functions. For instance module like this: ```kt class MyModule : Module() { override fun definition() = ModuleDefinition { function("f1") { return@function "string" } function("f2") { param: String -> return@function true } } } ``` can be typed using an interface like this: ```kt interface MyModuleTestInterface { fun f1(): String fun f2(param: String): Bool } ``` The test interface could be generated in the future, but for now, it is beyond the scope. After that, you are ready to create a mocked module: ```kt ModuleMock.createMock(MyModuleTestInterface::class, MyModule()) { // here you can access to the mocked object } ``` In the `createMock` block you have access to the `MyModuleTestInterface` object and if you call something on that it will be delegated to the exported method. # Test Plan - run tests for `expo-clipboard`
[expo-clipboard] Deprecate `setString` -> `setStringAsync` (#16320)* [JS] `setString` -> `setStringAsync` * [JS] Update tests * Build JS * Update docs schema * [Android] `setString` ->
[expo-clipboard] Deprecate `setString` -> `setStringAsync` (#16320)* [JS] `setString` -> `setStringAsync` * [JS] Update tests * Build JS * Update docs schema * [Android] `setString` -> `setStringAsync` * Update iOS * Update NCL * Updated CHANGELOG * Apply suggestion
[Android][clipboard] Rewrite module to Sweet API (#16269)* [clipboard][android] Refactor module to Sweet API * Prepare test utils * Update clipboard tests * Fix spotless * Update CHANGE
[Android][clipboard] Rewrite module to Sweet API (#16269)* [clipboard][android] Refactor module to Sweet API * Prepare test utils * Update clipboard tests * Fix spotless * Update CHANGELOG * Add one more test case * Apply suggestions * Update tests * Fix spotless * Event name as constant
[android] Add kotlin spotless ktlint linter for bare-expo (#13596)# Why In [#12545](https://github.com/expo/expo/pull/12545) ktlint was added to expo-go, but it didn't work with bare app. # H
[android] Add kotlin spotless ktlint linter for bare-expo (#13596)# Why In [#12545](https://github.com/expo/expo/pull/12545) ktlint was added to expo-go, but it didn't work with bare app. # How 1. Add spotless plugin, configure ktlint in accordance with how it was already implemented in expo-go. 2. Fix current lint errors
[clipboard] add native implementation for expo-clipboard (#13050)* add native code for expo-clipboard * add more to NCL * integrate into Expo Go * typescript imrprovements * autogenerat
[clipboard] add native implementation for expo-clipboard (#13050)* add native code for expo-clipboard * add more to NCL * integrate into Expo Go * typescript imrprovements * autogenerate docs * ts fixes to ncl * update docs * remove console log * Update packages/expo-clipboard/CHANGELOG.md Co-authored-by: Expo CI <[email protected]> * fix tests * android native unit tests * [skip ci] edit build.gradle * remove @unimodules/core: ~7.1.0 Co-authored-by: Expo CI <[email protected]>