heylinda-app icon indicating copy to clipboard operation
heylinda-app copied to clipboard

Write unit tests

Open watadarkstar opened this issue 2 years ago • 3 comments

We are always interested in people writing more unit tests 😄

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

  • [x] useMsToTime.ts
  • [x] useMsToMinutes.ts

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

  • [x] LoadingScreen.tsx
  • [x] Screen.tsx
  • [x] Themed.tsx

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

watadarkstar avatar Jul 28 '21 15:07 watadarkstar

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.

EmersonPinheiro avatar Aug 04 '21 18:08 EmersonPinheiro

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:

  • useMsToTime
  • useMsToMinutes

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

Namaste! 🧘‍♂️

watadarkstar avatar Aug 04 '21 18:08 watadarkstar

Is the issue still open?

akashroy1 avatar Oct 01 '23 06:10 akashroy1