Coder Social home page Coder Social logo

organizacion-sessio-3-martaalbertgarcia / tdd-node-sample-actions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from curso-github-cefire/tdd-node-sample-actions

0.0 0.0 0.0 29 KB

Repositorio de ejemplo de integración continua con GitHub Actions

JavaScript 100.00%

tdd-node-sample-actions's Introduction

Ejemplo proyecto TDD NodeJS

Fuente: https://www.taniarascia.com/unit-testing-in-javascript/

Ejecución de tests en GitHub Actions

Fuente: https://docs.github.com/en/actions/guides/building-and-testing-nodejs

El fichero .github/workflows/testnode.yml contiene la configuración necesaria para activar la acción de ejecución de tests. Está convenientemente comentado.

Instalación de Node

Disponible en https://nodejs.org/es/

Documentación

El test definido en test1.js utiliza el módulo assert integrado en Node.

El test definido en test2.js utiliza la librería should.

Instalación

npm install

Ejecución de tests

npm test

Añadir más tests

Se pueden añadir más ficheros de test en la carpeta test. Los nuevos archivos que se añadan a dicha carpeta se ejecutarán al llamar a npm test.

La metodología de Desarrollo Guiado por Pruebas consiste en los siguientes pasos:

  1. Elegir un requisito
  2. Escribir un test
  3. Comprobar que el test falla
  4. Crear el código para que pase el test
  5. Comprobar que se pasan todos los tests
  6. Refactorizar el código (eliminar duplicidades, etc.)
  7. Volver a comprobar que se pasan todos los tests

tdd-node-sample-actions's People

Contributors

martaalbert avatar pedroprieto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.