Does anyone know how I can mock functions when wri...
# javascript
v
Does anyone know how I can mock functions when writing unit tests?
g
Mockk has some experimental support of mocking for Kotlin JS http://mockk.io/
👍 1
But why do you need this? Usually it’s a bad sign if you want to mock top level function
v
If I have a class calling methods from another class, I don't care about the operations in that class, just the return values, shouldn't I be mocking the methods being called?
g
But this is a mocking of methods, it’s not the same as mocking top level functions
v
Ah yes. Sorry, I was using the wrong terminology. I want to mock methods, not top level functions.