Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Feb 5, 2022
1 parent 850c78f commit 4a417e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/test/kotlin/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.plus
import kotlinx.coroutines.test.TestCoroutineScope

private val mockCoroutineScope = TestCoroutineScope()

fun mockKord(): Kord =
mockk {
Expand All @@ -16,4 +21,5 @@ fun mockKord(): Kord =
every { defaultStrategy } returns strategy
}
every { defaultSupplier } returns supplier
every { coroutineContext } returns mockCoroutineScope.coroutineContext
}

0 comments on commit 4a417e9

Please sign in to comment.