My New Test Model - treating test fixtures with th...
# feed
d
My New Test Model - treating test fixtures with the respect they deserve http://oneeyedmen.com/my-new-test-model.html
m
minutest
is pretty great - we've been using it to supplement our other testing in our projects we usually have something like
Copy code
inline fun <reified T> testFactory(noinline builder: TestContextBuilder<Unit, T>.() -> Unit): Stream<out DynamicNode> =
    testFactoryFor(
        rootContext(builder = builder)
    )
and don't inherit from
JUnit5Minutests
so we can express tests as "multiple" contexts
d
I'm glad you like it. Does the fact that JUnit5Minutests will now run any public methods returning the result of
rootContext
allow you to do the same thing?
m
yeah i think that would work just as well. i think we've been following this pattern so far as we've been replacing all of our
DynamicTest.dynamicTest
and
DynamicContainer.dynamicContainer
, since those methods usually are something like
Copy code
@TestFactory
fun `some test method`(): Stream<out DynamicNode> = Stream.of(...)
seems like
testFactory
is our own analogous representation when we started to use minutest (which is recently)
d
I'm discovering that I'm not the only one to have seen the potential of @TestFactory!