I'm currently playing with the Kotlin testing Framework https://github.com/kotlintest/kotlintest.
I want to know if there is an expected way to structure the project, I mean, like a base project where I can start base on.
I'm currently playing with the Kotlin testing Framework https://github.com/kotlintest/kotlintest.
I want to know if there is an expected way to structure the project, I mean, like a base project where I can start base on.
There is no specific way to structure the project just for this testing framework. You should structure it as any other Kotlin project, so your test should go to your-project/src/test/kotlin/com/jimmy/
The important thing is just to extend one of available base classes from kotlintest eg. WordSpec
You can see how it all (both structure and tests) looks like in kotlintest itself - https://github.com/kotlintest/kotlintest/tree/master/src/test/kotlin/io/kotlintest
You can test your code using spek, Here is the exaple, that might help to implement on your project.
There are some KotlinTest sample projects in the main repo here: https://github.com/kotlintest/kotlintest/tree/master/kotlintest-samples
They use KotlinTest 3.0.x and for gradle users, the build file looks like:
apply plugin: 'org.junit.platform.gradle.plugin'
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.junit.platform:junit-platform-gradle-plugin:1.1.0"
}
}
dependencies {
testCompile 'io.kotlintest:kotlintest-runner-junit5:3.0.3'
}
I won't include the Maven example as the pom.xml is verbose because it's XML, but you can find it in the above link.