DEV Community

Cover image for Agregar un step de coverage en github actions - Frontend (Angular)
Danniel Navas
Danniel Navas

Posted on

2 1

Agregar un step de coverage en github actions - Frontend (Angular)

Con la llegada de github actions se ha simplificado la creación de flujos CI/CD y uno de los pasos importantes es los de las pruebas unitarias y que mejor que tener un step que valide nuestra cobertura, por eso dejo un script que puede ayudarnos a cubrir.
Primero creamos una carpeta llamada .github en la raíz de nuestro.
Dentro de esta creamos otra de la siguiente forma .github/workflows
Por último un archivo yml con el siguiente nombre por buena practica coverage.yml dentro de el dejaremos el siguiente código.

name: CI Angular app through Github Actions
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 14.x
        uses: actions/setup-node@v1
        with:
          node-version: 14.x

      - name: Setup
        run: npm ci

      - name: Test
        run: |
          npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
Enter fullscreen mode Exit fullscreen mode

Tip: La ultima línea es la ejecución de pruebas unitarias en angular esta puede ser remplazada por el de tu preferencia, recuerda que debe ejecutarse bajo un navegador sin interfaz.

Espero te ayudara este post.

Gracias por leer, nos vemos en la próxima.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay