hi, is it possible to pass some arguments to the t...
# kotest
e
hi, is it possible to pass some arguments to the tests?
f
Yep:
Copy code
companion object {
        @JvmStatic
        fun generateArguments() = listOf(
            Arguments.of(
                "bla bla bla",
             "bla bla bla"
            )
        )
}

@ParameterizedTest
    @MethodSource("generateArguments")
    fun fooTest(url: String, expected: String) {
        url.extension1 `should be equal to` expected
    }
👍 1
e
is it possible to integrate it with CI?
f
Depends on your CI, but I think yes
e
GH action
f
Never used it, sorry!
e
what do you use?
f
Right now I'm using Bitrise and CircleCI, I've used also Jenkins and planning to use Github actions
m
I'm confused. This is a kotest channel, yet that code looks like JUnit5. Kotest supports both property based testing and data-driven testing (which is effectively what the above example is). https://github.com/kotest/kotest#check-all-the-tricky-cases-with-data-driven-testing
s
Data driven testing like @Mike says and in 4.0 you can use test factories for completely dynamic tests.
👍 2
e
@sam can you help me? How can I pass arguments?
m
See the code samples in the docs. It's a slightly different format than JUnit as you construct the data table, and then iterate on the rows, but the docs are quite clear on how to use it. I linked to the docs above in the thread.