mobxjs / mobx-react

React bindings for MobX
https://mobx.js.org/react-integration.html
MIT License
4.85k stars 349 forks source link

Test cases for @computed and @action with enzyme ? #782

Closed ksunilssah closed 4 years ago

ksunilssah commented 5 years ago

I am wondering how to test @computed with enzyme. I am fairly new to this looking for pointer.

danielkcz commented 5 years ago

I don't think you should test @computed at all as any kind of state is an implementation detail. Instead, focus on the output produced by your components and test that.

It's generally "problem" with Enzyme which allows it. I would really recommend NOT to. If you cannot change to RTL then I guess I have no other advice.

danielkcz commented 4 years ago

If you have further questions, please open a new issue with more details

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.