https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlintest
  • t

    thanh

    04/28/2017, 4:23 AM
    any one has this experience and how to solve it?
    b
    • 2
    • 3
  • a

    Alowaniak

    05/23/2018, 12:51 PM
    If I run a gradle test task from inside IntelliJ it shows up as Ignored however
    a
    s
    • 3
    • 3
  • h

    Hexa

    10/17/2018, 7:29 PM
    whats the difference between this https://mvnrepository.com/artifact/io.kotlintest/kotlintest-core/3.1.10 and this dependency https://mvnrepository.com/artifact/io.kotlintest/kotlintest/2.0.7? which one should I use for testing?
    a
    • 2
    • 3
  • m

    myanmarking

    11/13/2018, 12:02 PM
    java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize
    d
    • 2
    • 9
  • s

    Slackbot

    11/23/2018, 8:23 PM
    This message was deleted.
    d
    d
    • 3
    • 2
  • l

    LeoColman

    12/25/2018, 8:35 PM
    But I'm not sure if it's possible
    d
    • 2
    • 24
  • t

    thanksforallthefish

    01/08/2019, 7:31 AM
    is it possible to provide custom comparator (ala
    assertj
    http://joel-costigliola.github.io/assertj/assertj-core-features-highlight.html#custom-comparison-strategy) without using external libraries? does it even make sense in a kotlin world?
    d
    • 2
    • 1
  • l

    LeoColman

    01/16/2019, 12:36 PM
    Are you like clicking on the folder and
    Run all tests
    ?
    d
    • 2
    • 8
  • l

    LeoColman

    01/19/2019, 10:48 PM
    Regarding your first question, it's possible to compose scenarios and reutilize code for many similar scenarios, however. While writing a test that will display the same thing. With your example I might know how I'd solve it
    r
    • 2
    • 46
  • l

    LeoColman

    01/24/2019, 11:28 AM
    Did you erase the test?
    r
    • 2
    • 1
  • l

    LeoColman

    01/24/2019, 11:32 AM
    Maybe this isn't related to KotlinTest, but to your IDE. Check if the directory
    out
    exists. Sometimes compiled code won't be updated and it will seem that the test you deleted is still there
    r
    • 2
    • 2
  • d

    dave08

    02/01/2019, 9:18 AM
    Not true, since Android instrumentation tests need to be compiled to dex and installed on android to run... so it has to be compatible with all target device types... @sam
    s
    • 2
    • 1
  • a

    acando86

    02/20/2019, 1:03 AM
    hello. I have an existing module with a kotlin test suite written in junit4. After importing
    kotlintest-runner-junit4 v.3.2.1
    as dependency (without using or configuring it, just importing!), i'm getting the following exception when trying to run the test suite from intellij 2018.3.4/android studio3.3. Works 100% fine when running from gradle (im using gradle5). Works 100% fine when running individual test files from intellij/Android studio. I would like to migrate to kotlintest gradually in this project, so the plan was to have all new tests written in kotlintest and keep the existing ones in junit for a while. Is there a way to do this without compromising the possibility to run the test suite from intellij? i've seen a previous issue reported on this, but it has been closed: https://github.com/kotlintest/kotlintest/issues/385 so maybe i'm missing something. Thanks
    Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/launcher/TestExecutionListener
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at com.intellij.junit5.JUnit5IdeaTestRunner.createListeners(JUnit5IdeaTestRunner.java:39)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:45)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    s
    l
    • 3
    • 4
  • l

    LeoColman

    02/20/2019, 11:56 AM
    We also had this kind of conversation here: https://github.com/kotlintest/kotlintest/issues/650
    a
    • 2
    • 2
  • y

    Yuan Lin

    02/27/2019, 7:19 AM
    hello, nice to use kotlintest in our product and thanks here for providing this awesome tool! curious how’s the progress on the intellij plugin? I tried the 3.3.0.8 and still can’t get it work to run a single test
    s
    s
    • 3
    • 62
  • s

    sam

    03/01/2019, 12:02 AM
    KotlinTest 3.3.0 has been released.
    🎉 7
    b
    • 2
    • 2
  • t

    thanksforallthefish

    03/04/2019, 11:37 AM
    I am having a hard time upgrading from
    3.1
    . Given this production class
    class App {
    	companion object {
    		val threadLocal: ThreadLocal<String> = ThreadLocal()
    	}
    
    	val greeting: String
    		get() {
    			return threadLocal.get()
    		}
    }
    this test is successful in `3.1`m but fails in
    3.2
    and
    3.3
    import io.kotlintest.Description
    import io.kotlintest.Spec
    import io.kotlintest.shouldBe
    import io.kotlintest.specs.StringSpec
    
    class AppIntegrationTest : StringSpec() {
    	override fun beforeSpec(description: Description, spec: Spec) {
    		App.threadLocal.set("test")
    	}
    
    	init {
    		"greetings" {
    			App().greeting shouldBe "test"
    		}
    	}
    }
    • 1
    • 2
  • s

    sam

    03/04/2019, 12:16 PM
    If you have threads = 1 then the thread it uses should be the same thread as the listener
    t
    • 2
    • 8
  • b

    bbaldino

    03/06/2019, 9:39 PM
    do you guys know if it's possible to override the default test run shortcut in intellij to run a kotlintest config instead of junit?
    s
    • 2
    • 4
  • l

    LeoColman

    03/11/2019, 6:12 PM
    I think it's the latter. Let me try to add you to our conversation
    d
    • 2
    • 1
  • s

    sam

    03/12/2019, 10:58 PM
    Is your work all because of the reflection issue?
    l
    • 2
    • 1
  • b

    bbaldino

    03/12/2019, 11:02 PM
    ran into a weird bug using table testing. an array out of bounds in SignatureParser, of all things...when i run the test outside of a table test it seems to work. i'll start a thread and post details.
    s
    • 2
    • 20
  • d

    dave08

    03/17/2019, 1:07 PM
    You personally only use one style all the time @sam?
    l
    s
    • 3
    • 42
  • d

    dave08

    03/17/2019, 1:20 PM
    Something a bit funny with the plugin... I press the double arrow next to the class name, it shows as if all the tests pass, but if I press the single arrow then it reports the tests that were supposed to fail 🤔. What is that double arrow anyways? Also, I keep having to choose between JUnit and KotlinTest in a submenu when running using the arrows...
    s
    • 2
    • 1
  • s

    sam

    03/18/2019, 12:18 AM
    if you can make a ticket for me I would add it
    👍 1
    a
    • 2
    • 3
  • b

    bbaldino

    03/18/2019, 9:00 PM
    seeing weird behavior, i have a test defined like this:
    s
    • 2
    • 9
  • s

    sam

    03/20/2019, 8:01 PM
    Oh right, well roboelectric uses junit 4 ?
    l
    • 2
    • 1
  • b

    bbaldino

    03/21/2019, 11:33 PM
    are there plans to leverage contracts? i find i do something like this here and there:
    val result = func(): String?
    result shouldNotBe null
    result as String
    result.startsWith("...") shouldBe true
    s
    l
    • 3
    • 39
  • l

    LeoColman

    05/06/2019, 12:56 PM
    lol
    s
    • 2
    • 1
  • s

    Sergio Crespo Toubes

    05/16/2019, 7:57 AM
    can i verify with kotlintest, no exception thrown?
    t
    • 2
    • 1
Powered by Linen
Title
s

Sergio Crespo Toubes

05/16/2019, 7:57 AM
can i verify with kotlintest, no exception thrown?
t

tseisel

05/16/2019, 8:05 AM
Sure, have a look at the
shouldNotThrow
function :
shouldNotThrow<Exception> {
    foo()
}
👍 2
View count: 1