Skip to content

Instantly share code, notes, and snippets.

View eduardorgv's full-sized avatar
馃彔
Working from home

Eduardo Rodr铆guez eduardorgv

馃彔
Working from home
View GitHub Profile
@eduardorgv
eduardorgv / vite-testing-config.md
Last active February 8, 2023 15:41 — forked from Klerith/vite-testing-config.md
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalaci贸n y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
npm i --dev jest babel-jest @babel/preset-env @babel/preset-react 
npm i --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@eduardorgv
eduardorgv / validations.ts
Created June 21, 2022 21:12 — forked from Klerith/validations.ts
Validar email
export const isValidEmail = (email: string): boolean => {
const match = String(email)
.toLowerCase()
.match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
);