E
E
Egor Dovydenko2022-01-19 12:06:23
React
Egor Dovydenko, 2022-01-19 12:06:23

What exactly should be covered by unit tests in React apps?

I want to understand the issues of testing react applications.
For example, there is a fairly large project. Many components, redux, saga, etc.
I have superficially studied the theory of writing tests.
But there is a question that has not yet been answered:

- How exactly should you determine what to write tests for?

Those. you can write tests for everything - what is there such a line, and there the function works on click, there the length of the array is such and such, and there such and such a component is rendered ... But in this way there will be more tests than the main code.

I would be grateful for clarifications and / or material on the topic of the question.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2022-01-19
@Casufi

On our project, for example, if the code coverage with tests is less than 80%, then it will not build. So everything needs to be covered with tests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question