Skip to content

Commit

Permalink
[expo-module-template] Add unit tests in android module template.
Browse files Browse the repository at this point in the history
  • Loading branch information
mczernek committed Jul 29, 2020
1 parent fc7bc75 commit b5532de
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/expo-module-template/CHANGELOG.md
Expand Up @@ -7,11 +7,3 @@
### 🎉 New features

### 🐛 Bug fixes

## 8.3.1 — 2020-05-29

*This version does not introduce any user-facing changes.*

## 8.3.0 — 2020-05-27

*This version does not introduce any user-facing changes.*
3 changes: 3 additions & 0 deletions packages/expo-module-template/android/build.gradle
Expand Up @@ -75,4 +75,7 @@ repositories {
dependencies {
unimodule 'unimodules-core'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet("kotlinVersion", "1.3.50")}"

testImplementation project(':unimodules-test-core')
testImplementation 'org.robolectric:robolectric:4.3.1'
}
@@ -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)
}

}

0 comments on commit b5532de

Please sign in to comment.