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

Klitos Kyriacou

02/25/2024, 4:09 PM
In a
beforeTest
inside a
FreeSpec
, is there a way to get a unique identifier of the test being performed? (e.g. a number, 1 being the first test, 2 being the second, or possibly a UUID or similar? I thought of using the hashCode of the test name, but test names don't necessarily have to be unique, and hashCodes of different strings don't have to be unique either.)
s

sam

02/25/2024, 4:54 PM
The context has a test descriptor, which you can get out a unique identifier which uses the test's full path, which is unique.
thank you color 1