Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Feb 16, 2023
1 parent f2e3bdd commit 17bf3b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/main/kotlin/entity/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import dev.kord.core.Markdown
import dev.kord.core.behavior.MessageBehavior
import dev.kord.core.behavior.UserBehavior
import dev.kord.core.behavior.channel.ChannelBehavior
import dev.kord.core.behavior.interaction.response.InteractionResponseBehavior
import dev.kord.core.behavior.channel.asChannelOf
import dev.kord.core.behavior.channel.asChannelOfOrNull
import dev.kord.core.behavior.interaction.InteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.InteractionResponseBehavior
import dev.kord.core.cache.data.MessageData
import dev.kord.core.cache.data.MessageInteractionData
import dev.kord.core.entity.application.ApplicationCommand
Expand All @@ -38,7 +37,6 @@ import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.*
import kotlinx.datetime.Instant
import kotlinx.datetime.toInstant
import java.util.*

/**
Expand Down
4 changes: 4 additions & 0 deletions core/src/test/kotlin/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.test.TestCoroutineScope

private val mockCoroutineScope = TestCoroutineScope()

fun mockKord(): Kord =
mockk {
Expand All @@ -16,4 +19,5 @@ fun mockKord(): Kord =
every { defaultStrategy } returns strategy
}
every { defaultSupplier } returns supplier
every { coroutineContext } returns mockCoroutineScope.coroutineContext
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ atomicfu-plugin = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", ver
binary-compatibility-validator-plugin = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
ksp-plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }

markdown = { group = "org.jetbrains", name = "markdown", version = "0.2.4" }

[bundles]

Expand Down

0 comments on commit 17bf3b0

Please sign in to comment.