Closed sksamuel closed 4 years ago
Kotest (previously kotlintest) has added support for Konform testing. https://github.com/kotest/kotest
Example:
val validateUser = Validation<UserProfile> { UserProfile::fullName { minLength(2) maxLength(100) } UserProfile::age ifPresent { minimum(0) maximum(150) } } val user1 = UserProfile("Alice", 25) validateUser shouldBeValid user1 val user2 = UserProfile("A", -1) validateUser.shouldBeInvalid(user2) { it.shouldContainError(UserProfile::fullName, "must have at least 2 characters") it.shouldContainError(UserProfile::age, "must be at least '0'") }
Would you like me to open a PR to add instructions to the readme?
I am glad that you find this project useful.
Yes, feel free to open a pull request.
PR created https://github.com/konform-kt/konform/pull/19
Kotest (previously kotlintest) has added support for Konform testing. https://github.com/kotest/kotest
Example:
Would you like me to open a PR to add instructions to the readme?