We took this approach because we wanted to treat tests as a “consumer” of your production code. In this sense it should inherit dependencies in the same way. That is, since other projects that depend on your code will not see these dependencies, neither should your tests. In many cases this does in fact result in a duplicate dependency declaration but for functional tests you’ll probably want to use a proper implementation dependency instead of the compileOnly
version anyhow.
1 Like