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
kotest
  • j

    Jonathan Lennox

    07/06/2022, 8:37 PM
    I have a method that's declared as returning
    Set<MyType>
    . I'm writing a test that uses
    shouldContainExactly
    to test it. When I instantiate the return value as a
    LinkedHashSet
    it works, but when I instead instantiate it as a
    HashSet
    I get:
    Disallowed: Set can be compared only to Set
    java.lang.AssertionError: Disallowed: Set can be compared only to Set
    May not compare HashSet with ArrayList
    expected:<*> but was:<*>
    What's going on here?
    l
    s
    • 3
    • 7
  • p

    peekandpoke

    07/12/2022, 7:59 AM
    Hi there! I am trying to run multiplatform tests (specifically JS) with the Snapshot builds 5.4.* But when I add a project dependency to
    io.kotest:kotest-framework-engine
    then some dependencies cannot be resolved, which means that JS tests cannot be run:
    Execution failed for task ':commonmp:compileKotlinJs'.
    > Error while evaluating property 'filteredArgumentsMap' of task ':commonmp:compileKotlinJs'
       > Could not resolve all files for configuration ':commonmp:kotlinCompilerPluginClasspathJsMain'.
          > Could not find io.kotest:kotest-framework-multiplatform-plugin-js-jvm:5.4.0.1048-SNAPSHOT.
            Searched in the following locations:
              - <https://repo.maven.apache.org/maven2/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
              - <https://repo.maven.apache.org/maven2/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
              - <https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
              - <https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
              - <https://jitpack.io/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
              - <https://jitpack.io/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
              - <https://oss.sonatype.org/content/repositories/snapshots/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/maven-metadata.xml>
              - <https://oss.sonatype.org/content/repositories/snapshots/io/kotest/kotest-framework-multiplatform-plugin-js-jvm/5.4.0.1048-SNAPSHOT/kotest-framework-multiplatform-plugin-js-jvm-5.4.0.1048-SNAPSHOT.pom>
    What appears strange to me is the pairing of js-jvm in
    kotest-framework-multiplatform-plugin-js-jvm
    Is there a way that I can work around this for the moment?
    e
    • 2
    • 9
  • c

    Charles Flynn

    07/12/2022, 5:15 PM
    In a similar way that there are multiple testing styles are there any plans for multiple assertion styles? Not a huge fan of the infix/extension style.
    s
    c
    r
    • 4
    • 8
  • j

    Javier

    07/14/2022, 11:40 AM
    Is it planned to add the rest of KMP targets to Kotest?
    s
    • 2
    • 8
  • d

    dimsuz

    07/19/2022, 12:12 PM
    Is there a matcher to assert each element of the list matches some predicate? Something like
    stringList shouldHaveEach { it.length > 10 }
    I have found
    shouldMatchEach
    but it requires assertions.size == list.size, not quite what I'm looking for. Or should I just use
    stringList.forEach { it.length shouldBeGreaterThan 10 }
    s
    • 2
    • 2
  • p

    phil-t

    07/22/2022, 10:25 AM
    Hi 👋 , I’ve just updated my Kotest dependencies from 4.6.3 to 5.3.0 and found that my
    beforeAll
    function has some issues that I need to fix:
    override fun beforeAll() {  // beforeAll is deprecated
            super.beforeAll()
            readConfig()
            RuntimeTagExpressionExtension.expression = tags  // Unresolved reference: RuntimeTagExpressionExtension
            ....
    readConfig()
    reads some values from a config file including the tags string, which is then set in
    RuntimeTagExpressionExtension
    but this seems to not exist in the new Kotest version This was working fine on the old version, but what is the correct way to do this with the new version? Am I correct to change the function as below?
    override suspend fun beforeProject() {
            super.beforeProject()
            ....
    I also have a similar issue with
    afterAll
    s
    • 2
    • 13
  • l

    LeoColman

    07/24/2022, 3:22 PM
    Think I found something
    s
    m
    • 3
    • 15
  • s

    sam

    07/24/2022, 7:08 PM
    Kotest 5.4.0 has been released.
    :kotest: 4
    :party-parrot: 7
  • j

    jmfayard

    07/25/2022, 5:59 AM
    Bonjour, I'm loosing track of whether we at #refreshversions cover all of Kotest's Gradle dependencies Mind someone have a look at this list? https://jmfayard.github.io/refreshVersions/dependencies-notations/#testingkt
    s
    • 2
    • 1
  • j

    Javier

    07/25/2022, 10:53 AM
    Which are the newer artifacts for mock server extension?
  • j

    Javier

    07/25/2022, 10:53 AM
    io/kotest/extensions/kotest-extensions-mockserver/1.2.1/
    ☝️ 1
  • j

    Javier

    07/25/2022, 10:53 AM
    io/kotest/kotest-extensions-mockserver/4.4.3/
  • j

    Javier

    07/25/2022, 10:54 AM
    extensions are not following the main release version (5.4.0)?
    e
    s
    l
    • 4
    • 5
  • j

    Javier

    07/25/2022, 3:09 PM
    Is there any reason two arb can be added? For example
    val clientErrorCodes: Arb<Int> = <http://Arb.int|Arb.int>(400, 406) + <http://Arb.int|Arb.int>(408, 499)
    s
    • 2
    • 6
  • r

    Rajkumar Singh

    07/28/2022, 4:27 AM
    switched <kotest.version>5.3.2</kotest.version> to <kotest.version>5.4.0</kotest.version> and now I'm getting
    java.lang.NoSuchMethodError
    j
    s
    e
    • 4
    • 11
  • s

    sam

    07/28/2022, 5:41 AM
    @Rajkumar Singh Can you move the stack trace to the thread
  • d

    Didier Villevalois

    07/28/2022, 2:46 PM
    It looks like by bumping 5.3.2 to 5.4.1, all my commonTest tests are not executed at all on native (linuxX64). Trying to understand the problem... Will add more info as soon as I understand what is going on. (You can try running
    ./gradlew :kzmq-tests:linuxX64Test
    on https://github.com/ptitjes/kzmq.)
    c
    s
    • 3
    • 15
  • w

    wasyl

    08/01/2022, 11:26 AM
    Hi there, quick question about Listeners: I see that
    Listener
    class is deprecated, and
    listeners()
    method on
    AbstractProjectConfigs
    suggests to use `Extension`s instead. However,
    TestListener
    interface (and all the
    BeforeEachListener
    and friends) is not deprecated. Is it an oversight, or I should keep implementing a
    TestListener
    and registering it as an extension?
    s
    • 2
    • 13
  • c

    Chad Moller

    08/03/2022, 8:18 PM
    Hey, I've added a very small but convenient extension to provide scope in an assertSoftly block
    inline fun <T, R> T.assertSoftly(assertions: T.() -> R): R {
       return io.kotest.assertions.assertSoftly { this.assertions() }
    }
    Are there any thoughts or objections about adding this to kotest, along with other similar scoping functions? An example of its use:
    val user = buildUser()
    user.assertSoftly {
        name shouldBe "Bob"
        role shouldBe Role.ADMIN
    }
    s
    l
    a
    • 4
    • 36
  • c

    Corey

    08/03/2022, 9:16 PM
    Hi there, whenever I try to use
    IsolationMode.InstancePerTest
    +
    KoinExtension
    or manually starting
    Koin
    I get:
    No tests found for given includes: [com.app.MySpec](--tests filter)
    Anyone know why it is happening?
    • 1
    • 1
  • c

    christophsturm

    08/05/2022, 4:36 PM
    is a collection with just one element really a singleton? https://github.com/kotest/kotest/blob/0ba14983d485b1b1caef0e5a2cd7402ba47e34d2/kot[…]c/commonMain/kotlin/io/kotest/matchers/collections/singleton.kt
    l
    s
    • 3
    • 5
  • l

    LeoColman

    08/09/2022, 9:29 PM
    https://docs.gradle.org/current/userguide/platforms.html#sec:sharing-catalogs
  • l

    LeoColman

    08/09/2022, 9:29 PM
    As we are creating a Kotest Bom, what about a Kotest version catalog? It's an incubating gradle feature, but seems solid
    j
    t
    +2
    • 5
    • 10
  • l

    LeoColman

    08/09/2022, 9:29 PM
    From gradle 7+
  • s

    sam

    08/13/2022, 6:05 PM
    Yep lets turn it off
  • d

    Didier Villevalois

    08/16/2022, 9:49 PM
    It seems that `commonTest`s are reported (at least in IDEA's UI) differently whether they are ran from
    jsTest
    or
    linuxX64Test
    compared to
    jvmTest
    . When they are ran in
    jvmTest
    , they are reported with their fully-qualified names (e.g.
    org.zeromq.sockets.PushPullTests
    ), whereas, when ran from
    jsTest
    or
    linuxX64Test
    , they are reported with their simple class names (e.g.
    PushPullTests
    ). Is there a way to fix the names on the JS and native targets to use the fully-qualified names?
    e
    o
    • 3
    • 6
  • d

    Davio

    08/17/2022, 8:48 AM
    There seem to be some gaps between matchers for URI and URL, for instance there is an extension matcher
    URL.shouldHaveParameterValue(key: String, value: String)
    but URI only has
    URI.shouldHaveParameter(key: String)
    , is there a roadmap issue to close this gap?
    s
    • 2
    • 2
  • s

    simon.vergauwen

    08/17/2022, 4:44 PM
    Hey all, Anyone having issues pulling in Kotest 5.4.2? It seems watchosx86 has not been uploaded to Maven Central correctly (maybe some others), Windows & Ubuntu build fine for me but MacOs currently fails on being unable to find watchosx86. I checked Maven Central and it's indeed not there for that target.
  • s

    sam

    08/17/2022, 4:48 PM
    It might not have been published properly. I guess we could push out 5.4.3
    s
    e
    • 3
    • 2
  • j

    juh juh

    08/19/2022, 8:13 PM
    Hello, does kotest support kotlin 1.7.20? I'm getting errors when trying to run
    Compilation failed: org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.addChild(Lorg/jetbrains/kotlin/ir/declarations/IrDeclarationContainer;Lorg/jetbrains/kotlin/ir/declarations/IrDeclaration;)V
    
     * Source files: BundleTest.kt
     * Compiler version info: Konan: 1.7.20-Beta / Kotlin: 1.7.20
     * Output kind: LIBRARY
    This error only appeared after I added
    kotest
    to my project My repository: https://gitfront.io/r/juh9870/wzWHt7gwZ73c/match3kt/
    e
    • 2
    • 1
Powered by Linen
Title
j

juh juh

08/19/2022, 8:13 PM
Hello, does kotest support kotlin 1.7.20? I'm getting errors when trying to run
Compilation failed: org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.addChild(Lorg/jetbrains/kotlin/ir/declarations/IrDeclarationContainer;Lorg/jetbrains/kotlin/ir/declarations/IrDeclaration;)V

 * Source files: BundleTest.kt
 * Compiler version info: Konan: 1.7.20-Beta / Kotlin: 1.7.20
 * Output kind: LIBRARY
This error only appeared after I added
kotest
to my project My repository: https://gitfront.io/r/juh9870/wzWHt7gwZ73c/match3kt/
e

Emil Kantis

08/26/2022, 8:22 PM
I suspect Jetbrains did a breaking change in the IR stuff again.
View count: 12