Join Slack
How can I inject (in the Koin) mocked objects in a Ktor app in tests?
# getting-started
ł
Łukasz Bednarczyk
08/22/2021, 7:05 PM
How can I inject (in the Koin) mocked objects in a Ktor app in tests?
d
Dmitry
08/23/2021, 12:14 AM
Don't use mocked objects, use fake objects
ł
Łukasz Bednarczyk
08/23/2021, 4:32 AM
What? O.o how do you want to use a fake repository? Give me an example
n
Nikolai Wotton
08/23/2021, 9:16 PM
What he means is create a class that extends/inherits the object you are injecting and override everything to be no-op
ł
Łukasz Bednarczyk
08/24/2021, 7:11 AM
Ok, but it isn’t the solution. The problem is injecting new object in place old.
d
Dmitry
08/26/2021, 12:39 PM
I don't any problem here)
Dmitry
08/26/2021, 12:40 PM
Just create many interfaces and inherit them. That's ok!
4
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by