Hey everyone. How can I split my unit tests and in...
# javascript
k
Hey everyone. How can I split my unit tests and integrations test into two different test tasks? I am trying to have two test tasks, 1 for unit tests and another for integration tests. My config currently looks like this
Copy code
kotlin {
    target {
        browser {
            testTask {
                useKarma {
                    useChromeHeadless()
                }
            }
        }
    }
}
This generates
project-test.js
file for the test directory. I created another
integrationTest
directory but I cannot figure out how to configure the test tasks to look for the integration tests directory.
Though not exactly what I wanted, but I was able to split integration test from unit test using
<http://filter.ec|filter.exclueTestMatching
function as follows>
Copy code
testTask {
                filter.excludeTestsMatching("*Integration*")
                useKarma {
                    useChromeHeadless()
                }
            }
If anyone has a better approach I am interested.
r
I can’t help too much as I have examples of a slightly different use case, but it looks like the tools are there to create a new js compilation (which automatically creates an associated sourceset), and there should be ways to get the plugin to create a test task for that sourceset.
i haven’t done the latter myself as I needed to use a custom test task