https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
o

Otis Goodman

02/22/2023, 9:06 PM
Is there a way to define a custom order for you tests with
kotlin.test
? I am testing a multiplatform web api wrapper and I want my code to create an object first assert there is no errors then delete it while asserting no errors. Is there some sort of trick to order test functions?
s

s3rius

02/22/2023, 9:15 PM
It's usually a bad sign if tests have to run in a certain order to work. Each test should be a complete unit in itself. If deletion fails without creation, then deletion itself isn't a valid successful test case.
So I'd just move it into one test.
o

Otis Goodman

02/22/2023, 9:17 PM
ah thanks!
120 Views