the `GlobalScope.async { "testCarId" }` part seems...
# mockk
h
the
GlobalScope.async { "testCarId" }
part seems weird to me I tried
returns  "testCarId"
but I'm getting an incompatible type error
o
It is hard to understand what you are trying to achieve.
Please explain more.
h
yep
parseCarAsync()
is just an async function that returns a string
Copy code
parseCarAsync(test1: String, test2: String) = GlobalScope.async{ 

// make expensive network call here

//return@async  return some string here
}
i just want to mock it and return a fake answers
o
So the type is actually Deferred
Replacing it with
GlobalScope.async { "something" }
should be exactly what you want. Why there is any doubts about it ?
h
Thanks @oleksiyp,
GlobalScope.async { "something" }
syntax just looks weird, why can't I just return Deferred("testCardId") or use any subclass that extends Deferred
o
Up to you, but this out of scope of mocking framework
More a question to coroutines channel on how to create Deferred simpler
h
Thanks @oleksiyp