heylinda / heylinda-app

The open source and free meditation app alternative for everyone. Built with React Native and Expo.
https://heylinda.netlify.app
GNU Affero General Public License v3.0
672 stars 164 forks source link

Write unit tests #7

Open watadarkstar opened 3 years ago

watadarkstar commented 3 years ago

We are always interested in people writing more unit tests 😄

Here are some good and easy places to write unit tests:

Here are some good and easy places to write component tests:

But before writing any component tests I highly recommend we complete issue #43 and setup React Native Testing Library.

EmersonPinheiro commented 3 years ago

Hello there!

First of all, thanks for sharing this project with the React Native community. This is the first time that I contribute to an open source project, and, since I was looking for an opportunity to start learning unit testing for React Native, this issue seems to be a good one. But, I'm new in this open source world, so I have a few questions. First of all, in the case of writing tests for the application, does my first unit test PR needs to cover all components/screens? If it doesn't, do I need to close this issue (like is said in the pull request template), or do I just need to reference it (e.g. writing "Relates to #7" in the Ticket Link section)? Thank you in advance.

watadarkstar commented 3 years ago

Hey @EmersonPinheiro :) Yeah this issue is a bit vague. Let's get more specific. Have you ever used React Native Testing Library? Maybe you can set that up!

See this issue I just created: https://github.com/heylinda/heylinda-app/issues/43

If we can set that up then we can start writing component tests.

Otherwise you could write some unit tests for our hooks. For example:

And to answer your question. Yes just write "Related to #7"

Namaste! 🧘‍♂️

akashroy1 commented 1 year ago

Is the issue still open?