Skip to content

Instantly share code, notes, and snippets.

View getellez's full-sized avatar
🏠
Working from home

German Tellez Vanegas getellez

🏠
Working from home
View GitHub Profile
@Klerith
Klerith / vite-testing-config.md
Last active September 22, 2024 20:52
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@ali-kamalizade
ali-kamalizade / healthcheck.js
Last active September 18, 2024 14:57
A sample implementation of a health check endpoint for Node.js using Express
// 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)