Trace your Unit tests progress with Codecov
Using React and Github actions
Unit tests are a fundamental part of your application. With Codecov you can simplify the analysis of the trend of your tests.
Hi Devs, I’m Daniele Carta and I’m a Frontend Developer.
When you create a React Application, probably you write a lot of unit tests (I hope) but, probably, you don’t use any tools to monitoring the progress of your unit tests.
A very nice free tool is Codecov.
Codecov is perfectly integrated with Github, in fact, you can import your repository directly from Github.
In this screenshot you can see Codecov in action. In this graph we have the change of the coverage day by day.
Create a Github Action to deploy your tests into Codecov
So, now I show you a simple Github Action that deploy your unit tests into Codecov.
Is important to understand two things about of this Action:
- The first: you can replace the “…install dependencies of your project” with a series of command like this (is an example):
name: Install dep
run: npm install - The second: you must have a command in a package.json renamed “test:coverage” to run before the deploy to Codecov
Thanks for reading the article, I hope it was useful for you!
Feel free to follow me on: