dispix / react-pirate

MIT License
52 stars 6 forks source link

Tests #5

Open ckknight opened 6 years ago

ckknight commented 6 years ago

How would you like to do testing of react-pirate?

My first inclination is to use jest, have a sibling file for each hook, e.g. useMount.test.js, and within there, make one or more example components and test them in a similar manner to https://medium.com/@_kamerontanseli/testing-a-component-that-uses-react-hooks-e4f9b72ab53c

I'm happy to help out with this, just want to agree upon an approach before diving in.

dispix commented 6 years ago

Hi ! I would definitely test this with jest, but not sure how to approach the subject. The article you linked is more about testing a "hooked" component, but gives some insights. Will think about that probably this week-end but in the meantime if you have any suggestion I'm open to it :)