Giter Site home page Giter Site logo

juanpms2 / 9_react_testing_exercise Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.66 MB

Práctica del módulo 9 del máster. Testing en React con Jest y Cypress. Integración continua en Travis y Circle CI.

TypeScript 84.12% HTML 0.41% JavaScript 15.48%
testing jest cypress travis circleci react integration

9_react_testing_exercise's Introduction

React Testing Exercise witch Jest and Cypress

Travis CI Circle CI
Build Status CircleCI

Instalación de librerías

En este proyecto de React instalaremos las siguientes librerías:

React Testing Library

npm install @testing-library/react --save-dev

react-hooks-testing-library

npm install --save-dev @testing-library/react-hooks react-test-renderer

jest-dom library

npm install --save-dev @testing-library/jest-dom

cypress io

npm install cypress -D


La integración continua se ha hecho en Travis para Jest (unit tests) y en Circle CI para Cypress (e2e) y Jest.

Tanto Jest como Cypress tienen su archivo README con la documentación y código utilizado.


Configuración de debug en VSCode

Creamos el archivo de configuración para hacer debug en VSCode. En nuestro caso crearemos un sigle test, otro con --wathAll y otro para ejecutar un archivo específico de test:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Jest single run",
      "program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
      "args": [
        "-c",
        "./config/test/jest.json",
        "--verbose",
        "-i",
        "--no-cache"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Jest watch run",
      "program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
      "args": [
        "-c",
        "./config/test/jest.json",
        "--verbose",
        "-i",
        "--no-cache",
        "--watchAll"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Jest selected file",
      "program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
      "args": [
        "${fileBasenameNoExtension}",
        "-c",
        "./config/test/jest.json",
        "--verbose",
        "-i",
        "--no-cache",
        "--watchAll"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    }
  ]
}

9_react_testing_exercise's People

Contributors

jpabloms2 avatar juanpms2 avatar dependabot[bot] avatar

Watchers

James Cloos 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.