Uzi Landsmann
05/21/2019, 10:50 AMval test by tasks.getting(Test::class) {
useJUnitPlatform { }
}
However, it is apparently marked unstable. Is there a way around this?codyoss
06/07/2019, 2:33 PMSpringListener
stuff. The app is also built on coroutines, and I am trying to put a breakpoint in a suspend function. Is there a known issue around my use case that anyone has heard of? To be clear my test does work when I just run it, and I am able to put breakpoints in the non-coroutine parts of my code.Hexa
06/19/2019, 7:52 AMimport io.kotlintest.AbstractProjectConfig
import io.kotlintest.IsolationMode
object ProjectConfig : AbstractProjectConfig() {
fun isolationMode(): IsolationMode = IsolationMode.InstancePerTest
private var started: Long = 0
override fun beforeAll() {
started = System.currentTimeMillis()
}
override fun afterAll() {
val time = System.currentTimeMillis() - started
println("overall time [ms]: " + time)
}
}
LeoColman
06/19/2019, 5:06 PMAbbas A
06/22/2019, 4:11 PMsam
06/22/2019, 6:17 PMTestListener
and you've overriden the beforeTest
function ?sam
06/29/2019, 6:45 AMbbaldino
07/17/2019, 8:19 PMtseisel
07/18/2019, 9:51 AMinfix fun <T> T.should(matcher: (T) -> Unit)
? What's its purpose ?
I use it like this :
person.should {
it.firstName shouldBe "John"
it.lastName shouldBe "Doe"
}
But that should
seems redondant to me.sam
07/22/2019, 3:38 PMLeoColman
07/22/2019, 3:58 PMDias
07/23/2019, 9:27 AMthanksforallthefish
07/24/2019, 9:11 AMorg.springframework.context.ApplicationEventPublisher
and I cannot unit test it. What I mean is, if I write a test like
class SomeTest(
private val applicationEventPublisher: ApplicationEventPublisher = mockk(relaxed = true),
private val myClass: MyClass(applicationEventPublisher)) : StringSpec() {...}
applicationEventPublisher
visible to the test is not the mocked one but the one instantiated from ProjectConfig
.
A workaround is to have
class SomeTest : StringSpec() {
private val applicationEventPublisher: ApplicationEventPublisher = mockk(relaxed = true),
private val myClass: MyClass(applicationEventPublisher)
...
}
so actually not a big dealthanksforallthefish
07/24/2019, 11:22 AMDias
07/25/2019, 10:31 AMsam
08/13/2019, 12:42 AMLeoColman
08/13/2019, 1:25 AM@Before
, but it's only for all test cases. Many times you have nested setups that will use the same input, but you'll have to repeat them over and over when using JUnitLeoColman
08/13/2019, 3:36 AMsam
08/24/2019, 9:31 PMthuytrinh
08/31/2019, 1:39 PMNothing here
menu pop. Not sure if this is a bug.sam
08/31/2019, 2:14 PMbbaldino
09/05/2019, 6:22 PMJohan Alkstål
09/08/2019, 7:15 AMExecution failed for task ':test'.
> No tests found for given includes: [com.projectfaceoff.rink.entities.EntityManagerTest](filter.includeTestsMatching)
I'm sure I've missed something in the setup or something or placed the test file in the wrong place, KotlinTest docs don't say much about those things expect how to config the gradle build file.
I have a class extended with BehaviorSpec
inside a test/kotlin/com.foo.bar/
folder and created a Given
When
Then
test.Sergio Crespo Toubes
09/10/2019, 2:48 PMfun loadData() = MainScope().launch {
}
sam
09/10/2019, 6:19 PMbbaldino
09/10/2019, 7:31 PMbbaldino
09/10/2019, 8:43 PMsam
09/12/2019, 2:31 PMStian N
09/19/2019, 10:39 AMleodeleon
09/24/2019, 3:10 PMleodeleon
09/24/2019, 3:10 PMwasyl
09/24/2019, 3:42 PMLeoColman
09/24/2019, 7:15 PMwasyl
09/24/2019, 7:16 PMLeoColman
09/24/2019, 7:18 PMwasyl
09/24/2019, 7:35 PMandroidx.test.runner.AndroidJUnitRunner
configured in the manifest and that’s it?
this will be in KotlinTest for 4.0So it doesn’t work in 3.x yet? Can you tell me what was the required change(s) to make it work?
LeoColman
09/24/2019, 7:37 PM