Lorenalgm / DevChallenge

A website for developers to improve their skills by doing front-end and back-end challenges
https://www.devchallenge.com.br/
1.13k stars 67 forks source link

Adding automated tests #54

Open KyroSx opened 3 years ago

KyroSx commented 3 years ago

The Reason

Due to the possibility of platform growth, I believe that the addition of automated tests (specs) is very important. Which could be done with React Testing Library (RTL) and Jest.

The addition of specs could help refactoring some code snippets, as well as improving maintenance, in addition to all the various advantages that testing brings. Therefore, with good spec coverage, the code quality would certainly increase.

What should be tested?

felipsbreno commented 3 years ago

Hi everone,

Like to see that they are thinking of adding automated tests to this project.

In order to help and start taking my first steps in the open source world I wanted to help in creating some tests.

Can the test file be created together with the component folder?

Below I used DevCard as an example, in this case we have index.js and styled.js, then I could have a DevCard.spec.js to test this component

image

Or create a test folder and have all the component tests in it, but in the image above I find it more interesting.