e

    edenman

    1 year ago
    I’ve got a “resources” abstraction in my KMP library that uses expect/actual declarations to do the actual work of “get the localized string” and “build a color value from HSL/RGB” etc. Works pretty well. I’m trying to add some unit tests for this code and running into the limitation of expect/actual (that you can’t swap it out for a dummy impl in tests). What do other people do for this sort of thing? Use an interface instead?
    I guess I can put robolectric in my kmp-android module and run them that way, but i’ve been trying to avoid doing that
    Kris Wong

    Kris Wong

    1 year ago
    DI + interfaces
    AKA fakes