Hi everyone, I’m facing an interesting situation w...
# kotest
j
Hi everyone, I’m facing an interesting situation where I’m using Kotest assertions with Junit5 and Testcontainers. If I have a test function that contains a call to shouldThrow or shouldThrowAny, then that function is no longer being recognised as a test. If I run the enclosing test class then all test functions will be run except those that contain shouldThrow/Any and if I run the test against that function specifically I get a “No tests found for given includes:” Does anyone know what could cause such a thing where including shouldThrow no longer makes a function recognisable as a test?
s
can you share your test file?
j
@Sourabh Rawat I’ll probably need to setup a demo project before sharing code as the current code is commercial.
I was hoping it’s a well known issue, but doesn’t look like it is. I have an ugly work around for now. But I’ll dig a little deeper in my free time and try to set up a small gradle build that demonstrates the issue.
s
Yeah. Never heard of such kind of issue before. It also depends on the spec style and where you are putting the code in it. Like behaviourspec can behave "in unexpected way" if you don't know how it works properly.
j
@Sourabh Rawat I’m actually using JUnit5. I’m only using Kotest assertions core module.