testFixtures classes of Lib-A cannot see testFixtures classes of Lib-B

Lib-A/src/testFixtures contains unit test classes that are used by several projects/modules.
Lib-B/src/testFixtures contains helper classes used by Lib-A (and other projects/modules).

Problem: Lib-B is not on the testFixturesCompileClasspath for Lib-A.
Lib-A build.gradle contains this:

        testImplementation(testFixtures('com.example:Lib-B:[2022,)'))

I’ve tried several different configurations, but cannot get Lib-A to compile (due to the missing Lib-B on the classpath) - any suggestions would be appreciated.

Eric

The dependency declaration:

testImplementation(testFixtures('com.example:Lib-B:[2022,)'))

is adding a dependency to Lib-A’s testCompileClasspath. To add a dependency to Lib-A’s test fixtures compile (testFixturesCompileClasspath), use the testFixturesImplementation configuration instead:

testFixturesImplementation(testFixtures('com.example:Lib-B:[2022,)'))
1 Like

Thank you @Chris_Dore, that worked!

1 Like