kosi-libs / MocKMP

A mocking processor for Kotlin Multiplatform
https://kosi-libs.org/mockmp
MIT License
188 stars 12 forks source link

Feature request: Option to mark generated code as public #40

Closed bsstokes closed 1 year ago

bsstokes commented 1 year ago

It'd be nice if there were a way to mark the generated classes and functions as public rather than internal.

In our ~150-module project, we use test fixtures to share common mocks and fakes. This lets us limit where we do KSP processing and the number of generated classes. Right now, we can't share the classes generated by MocKMP out of the box because they are internal.

The workaround is to provide our own public method, e.g.

fun anyPerson() = fakePerson()
fun mockDatabase(mocker: Mocker) = MockDatabase(mocker)

It'd be great if we didn't even have to include this boilerplate.

SalomonBrys commented 1 year ago

Feature added in 1.11.0.

https://github.com/kosi-libs/MocKMP#generated-classes--functions-visibility