Closed
Description
Currently, validations in test functions are implemented in different ways:
- Using kluent, e.g.
invoking { deserialize(schema.executeBlocking("{b{id, name, age}}")) } shouldThrow GraphQLError::class withMessage "Property id on B does not exist"
- Using custom implementations, e.g.
expect<IllegalAccessException>("ILLEGAL ACCESS") { schema.executeBlocking("{black_mamba {item}}", context = context { +"LAKERS" }).also(::println) }
- Using hamcrest, e.g.
assertThat(scenarioType["author"], nullValue())
This makes it unnecessarily complex and hard to maintain and should be consolidated, ideally towards a single, kotlin-native test library.
Ideas for alternatives:
- https://kotlinlang.org/docs/power-assert.html
- https://kotest.io/docs/assertions/assertions.html
- https://github.com/robstoll/atrium
- https://github.com/willowtreeapps/assertk
- https://github.com/assertj/assertj (since assertk is not that active and assertj works pretty well already)
- https://github.com/robfletcher/strikt (albeit not very active recently)