forked from expo/expo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[expo-module-template] Add unit tests in android module template.
- Loading branch information
Showing
3 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...o-module-template/android/src/test/java/expo/modules/template/ModuleTemplateModuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package expo.modules.template | ||
|
||
import io.mockk.mockk | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
import org.unimodules.test.core.PromiseMock | ||
import org.unimodules.test.core.moduleRegistryMock | ||
|
||
@RunWith(RobolectricTestRunner::class) | ||
class ModuleTemplateModuleTest { | ||
|
||
private var moduleRegistry = moduleRegistryMock() | ||
|
||
private lateinit var promise: PromiseMock | ||
|
||
private lateinit var module: ModuleTemplateModule | ||
|
||
@Before | ||
fun initializeMock() { | ||
promise = PromiseMock() | ||
module = ModuleTemplateModule(mockk()) | ||
} | ||
|
||
@Test | ||
fun testSomeGreatMethodAsync() { | ||
assertTrue(true) | ||
} | ||
|
||
} |