Closed tyler-reitz closed 4 years ago
@tyler-reitz to be honest I am just starting to learn testing so I am not an expert in this field. Maybe you can suggest something? For sure we need unit tests for our components 😊 I will assign you to that task. Thanks a lot for joining!
@arturbien TBH, I'm probably not that much further along than you in terms of testing experience, but I would love to get more practice. I think, for now, just setting up the test harness and assertions with Jest and getting snapshots of all the components makes sense. There are a few interesting helper libraries, that might be of interest depending on how well they're being maintained:
Once tests are in place, getting some CI going would be the logical next step.
@tyler-reitz sounds good to me! 😊 the jest-styled-components seems to be the most popular helper library for testing styled-components so lets go with that one. We'll see if something else comes up along the way. For now the things you mentioned should be sufficient.
Can you make a pull request when you write first few tests? I would then make it a separate branch so we could work on this together 🤟🏻
@arturbien Sounds good. Will get cracking on things over the weekend and open a PR as soon as some tests are in place.
@tyler-reitz any progress? 😊 also, I just started a Discord chat for React95 community, so I would be happy if you joined too 🤟🏻
@arturbien Ya! I got Jest and Enzyme working with rollup last night. Gonna start with actual tests today. Will jump on the Discord server too :+1:
Sup @arturbien and @tyler-reitz!
What do you guys think about using react-testing-library for this project? We could start testing a few components and improve this little by little :)
Thoughts?
@luizbaldi there's already some work done by @tyler-reitz on the "testing" branch, but I released v2 in the meantime with some new components and features, so we probably should make a rebase and update snapshots if we wanna continue with this. Tbh I am not experienced in testing so I don't really know which library would be the best fit. @tyler-reitz used jest, enzyme and react-test-renderer, but if there's a better option, we can switch to something else ☺
Oh, I didn't know about the testing branch, sorry 😅. Regarding react-testing-library
, the official react docs is now mentioning it as a primary choice, but enzyme
is a great tool too!
We can decide what's best for the project, no problem :)
@luizbaldi is react-testing-library
easier/faster to implement comparing to enzyme? There are only few basic components tested on testing
branch, so if you want we can make separate branch for tests in react-testing-library
and see how it goes. I will do my best to dive into testing soon and add some tests to the branch 😎
@arturbien Sounds great! react-testing-library
has like a different approach on how to write tests compared to enzyme
, and it's quite simple actually!
I'll start a new branch called testing-library
🚀
Can help with this if you lay out some bullet points of what you're looking for.