- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
// app.js: register the route. In our case, we don't want authorization for this route | |
app.use('/healthcheck', require('./routes/healthcheck.routes')); | |
// healthcheck.routes.js: return a 2xx response when your server is healthy, else send a 5xx response | |
import express from 'express'; | |
const router = express.Router({}); | |
router.get('/', async (_req, res, _next) => { | |
// optional: add further things to check (e.g. connecting to dababase) |