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.

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.

An example of statistics

In this screenshot you can see Codecov in action. In this graph we have the change of the coverage day by day.

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

Feel free to follow me on:

--

--

Hi, I’m Daniele Carta, Frontend Engineer @ illimity Bank. I love to coding and share online my knowledge with free e-book and free articles.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Daniele Carta

Hi, I’m Daniele Carta, Frontend Engineer @ illimity Bank. I love to coding and share online my knowledge with free e-book and free articles.