https://kotlinlang.org logo
#kotest
Title
# kotest
t

Terry Hope

11/16/2023, 3:13 PM
Hi, I need to know amount of tests in whole suite. But if spec fails while running beforeSpec, all the tests that are nested inside context is lost 🙂 Is there a way to know how many tests was about to be executed?
s

sam

11/17/2023, 5:09 PM
There's no way to know in advance as kotest allows dynamic tests.
You could have a test that does repeat(100) { test("test $it") {} } for example
t

Terry Hope

11/17/2023, 5:12 PM
if they're not in context we can see them
s

sam

11/17/2023, 5:15 PM
top level tests are known
nested tests are not
t

Terry Hope

11/17/2023, 5:18 PM
yea... i needed it for report generation. thank for replay though