Skip to content

Commit

Permalink
Merge branch 'test/signupviewmodel-frontend' of github.com:snuhcs-cou…
Browse files Browse the repository at this point in the history
…rse/swpp-2023-project-team-6 into test/signupviewmodel-frontend
  • Loading branch information
89645321 committed Nov 3, 2023
2 parents 2466c9c + 06c290b commit 1855c07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
testImplementation("androidx.arch.core:core-testing:2.2.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
Expand All @@ -83,6 +84,7 @@ dependencies {
val coroutinesVersion = "1.7.1"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")

// Preference
implementation("androidx.preference:preference-ktx:1.2.1")
Expand Down Expand Up @@ -119,10 +121,8 @@ dependencies {

implementation("androidx.hilt:hilt-navigation-compose:1.0.0")

// Test
// MockK
val mockkVersion = "1.13.8"
testImplementation ("io.mockk:mockk-android:$mockkVersion")
testImplementation ("io.mockk:mockk-agent:$mockkVersion")
testImplementation ("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation ("androidx.arch.core:core-testing:2.1.0")
testImplementation("io.mockk:mockk-agent:$mockkVersion")
testImplementation("io.mockk:mockk-android:$mockkVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.mockk.coEvery
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import junit.framework.TestCase.assertEquals
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
Expand All @@ -23,6 +24,8 @@ import org.junit.Rule
import org.junit.Test

class SignupViewModelTest {

@OptIn(DelicateCoroutinesApi::class)
private val mainThreadSurrogate = newSingleThreadContext("UI thread")

@MockK
Expand Down Expand Up @@ -50,6 +53,7 @@ class SignupViewModelTest {
viewModel = SignupViewModel(repository)
}

@OptIn(ExperimentalCoroutinesApi::class)
@After
fun tearDown() {
Dispatchers.resetMain()
Expand Down

0 comments on commit 1855c07

Please sign in to comment.