Skip to content

Instantly share code, notes, and snippets.

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

Marcos MarcAnt

🏠
Working from home
View GitHub Profile
@MarcAnt
MarcAnt / vite-testing-config.md
Created August 31, 2022 05:34 — 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:
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:

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
<h1>REGISTRO DE USUARIO</h1>
<form method="post" id="registro">
<label for="usuarioRegistro"></label>
<input type="text" placeholder="Usuario" maxlength="6" id="usuarioRegistro" name="usuario" required>
<label for="passwordRegistro"></label>
<input type="password" placeholder="Contraseña" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}" id="passwordRegistro" name="password" required>
let formRegistro = document.querySelector('#registro');
var user = document.querySelector('#usuarioRegistro').value;
let validarUser = () => {
let expression = /^[a-zA-Z0-9]$/;
if(user == "") {
document.querySelector('label[for="usuarioRegistro"]')
.innerHTML = '<p>Elemento vacio</p>';
<?php require 'header.php'; ?>
<h1>Productos</h1>
<section class="btn-content">
<a href="<?php echo RUTATOTAL;?>descartable"><div class="btn-icon"></div>Descartables</a>
<a href="<?php echo RUTATOTAL;?>ampolla"><div class="btn-icon"></div>Ampollas</a>
<a href="<?php echo RUTATOTAL;?>medicina"><div class="btn-icon"></div>Medicamentos</a>
<a href="<?php echo RUTATOTAL;?>quirurgico"><div class="btn-icon"></div>Equipo Quirúrgico</a>
<?php
try {
$conexion = new PDO("mysql:host=localhost;dbname=laferia", "root", "");
}catch(PDOException $e) {
echo "ERROR" , $e->getMessage();
die();
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled</title>
<link rel="stylesheet" href="style.css">
</head>
<?php
try {
$conexion = new PDO("mysql:host=localhost;dbname=laferia", "root", "");
}catch(PDOException $e) {
echo "ERROR" , $e->getMessage();
die();
}