For inclusion of implementation dependencies

Is there any way to force gradle to include another project’s implementation dependencies? I have a test project (projectB) that is trying to test another project (projectA). In order to do so it needs compile time access to projectA's implementation. I tried to do this in projectB:

dependencies {
    testImplementation project(path: ':projectA', configuration: 'runtimeClasspath')
}

But I get an error from Gradle saying that the selected configration cannot be used as a project dependency since it isn’t intended for consumption. Is there any way to force projectB to include projectA's implementation dependencies?