aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

Example on how to use a test library like jest? #13

Closed djalmaaraujo closed 6 years ago

djalmaaraujo commented 6 years ago

Would be nice to have an example of how to use tests with this library. Can you provide? Do we need to mock anything in special?

aweary commented 6 years ago

I don't think you should need to mock anything; as long as you render your components inside the Provider for whatever state instance their using, you should be able to just test it without doing any more work. I can try to write up an example.

djalmaaraujo commented 6 years ago

@aweary Thanks for your response. I think your project is great. I've been working with REDUX for a while and after some time it's almost like a 'pain' to keep repeating myself in this structure that redux follows. That's why I think your project is a great fit.

aweary commented 6 years ago

Thank you @djalmaaraujo! Reducing boilerplate and cognitive load is definitely a primary goal for react-copy-write 🙂