Open ckknight opened 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 :)
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-e4f9b72ab53cI'm happy to help out with this, just want to agree upon an approach before diving in.