So the withData() function does not have a paramet...
# kotest
v
So the withData() function does not have a parameter for test type, which makes it so it is essentially impossible to register a leaf test in a free spec. This is bad because if someone expects a beforeEach / afterEach to run, they would have to define each test explicity instead of consolidating with withData. The way to fix this is to just have the ability to pass a TestType in to withData instead of hard code it to DYNAMIC. This way a user could pass TEST in and generate proper leaf tests instead of the buggy/broken tests they would get from the DYNAMIC value. I have a friend who ran into this issue and he is willing to contribute it if need be,.
c
before/after callbacks are supported for data driven tests:
> If you wish to have before / after callbacks in data-driven tests, then you can use the standard beforeTest / afterTest support. Every test created using data-driven testing acts the same way as a regular test, so all standard callbacks work as if you had written all the test by hand.
e
v
Nice to see the PR is up for release. The problem with beforeAny/afterAny which behave the same behavior as before/after Test, is that I dont want to run the before/after code on my manual non leaf tests other than withData tests. The PR though that is out makes sense, I wonder if a testCase parameter can be taken in to not break other people's codebases... great to see this issue has been looked at though, looking forward to 6.0 release
s
I started removing the test types from junit, I have a PR up with one test left to fix.
If we can get the same thing working in intellij, then we don't need test types at all anymore, and data driven tests can blend in seemlessly anywhere
v
Hi sam, I am wondering what you are referring to byt moving the test types, and not needing test types at all anymore. Could you explain further, im not very well versed in all the details
s
It's how the test dsl knows if a test is a leaf or a container. It's defined by the DSL keywords.